Not logged inGosu Forums
Forum back to Help Search Register Login
Up Topic Gosu / Gosu Exchange / New probleme with ruby and Image.from_text
- - By grifdail Date 2011-12-01 22:40
This time its a very weird probleme, I was going to do a prerealease when suddenly, I notice that , without I change anything related, a message, usualy show using "@message = Gosu::Image.from_text" does'nt appear anymore. Just a few seconde before, all was working great. After doing some research I found, using the methode that the image was generated (a transparent fill with the good dimmension) but without the text in.
I hope you will be able to help me again! thank
Parent - - By jlnr (dev) Date 2011-12-01 22:46
Can you show some code? Are you using a font other than the default_font_name?
Parent - - By grifdail Date 2011-12-02 20:38
Here is the whole methode
      @text += [text]
      loop do
        txt = @text.join("\n")
        puts txt
        @messagdd = Gosu::Image.from_text($window,txt, Gosu.default_font_name, 24, 2, 640, :left) ("fff.png")
        if @messagdd.height > 256
          puts "hello"

Here the txt string has dispalyed by the console
-->Il est 21 heures passé de 33 minutes.
-->Je ne suis pas certain d'avoir tous compris.

I should have post the "fff.png" but as it's a totaly transparent file it wont upload
Parent - - By grifdail Date 2011-12-04 00:21
I simplified that for
    def say(text)
      @message = Gosu::Image.from_text($window, text, Gosu.default_font_name, 16, 2, 500-64, :center)

but it does'nt work anymore.
It start getting urgent so please if you could answer me quickly
Ho!! and I discover that, probably because of the thread (see my last post) , I can't see that an error happend. (fifth hours looking for a tiny unshow bug)
Parent - By jlnr (dev) Date 2011-12-04 15:24 Edited 2011-12-04 15:30
Oh, thread? Calling all this stuff in threads is not supported yet.

Otherwise, I cannot see any other reason why it would not work. You are on Windows, right? What is 'text'? Can you post text.inspect?
Up Topic Gosu / Gosu Exchange / New probleme with ruby and Image.from_text

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill