• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Question] Draw_text over pictures?

60
Posts
10
Years
  • Age 31
  • Seen Jul 9, 2015
Hello, it may seem like a stupid question but I can't manage to show the text, or any box at all, over a picture.

I'm using those functions: http://ruby-doc.org/gems/docs/o/openrgss-0.1.5/Bitmap.html And it doesn't say anything about priority or anything related to showing "over" something else, so I was wondering, if I'm missing something or there's another method to do that, how do I show drawn text over a picture on Rpg Maker XP?

Thanks in advance for any help :D
 

Luka S.J.

Jealous Croatian
1,270
Posts
15
Years
Hello, it may seem like a stupid question but I can't manage to show the text, or any box at all, over a picture.

I'm using those functions: http://ruby-doc.org/gems/docs/o/openrgss-0.1.5/Bitmap.html And it doesn't say anything about priority or anything related to showing "over" something else, so I was wondering, if I'm missing something or there's another method to do that, how do I show drawn text over a picture on Rpg Maker XP?

Thanks in advance for any help :D

If you're using Essentials, you have the
Code:
pbDrawTextPositions(bitmap,textarray)
which does it all for you. Otherwise in stock RMXP you can use (for a @sprite)
Code:
@sprite.bitmap.draw_text(x, y, width, height, str[, align])
For more info press F1 in RMXP, and search for "bitmap".

The priorities are determined in the order in which the code prints stuff onto the bitmap. There is no Z value or something. For instance if you used bitmap.blt and then bitmap.draw_text, you would first draw the bitmap image, and then overlay it with the text. So you need to structure your code right. An example in an update for instance:
Code:
bitmap = @sprite.bitmap
bitmap.clear
bitmap.blt(0,0,BitmapCache.load_bitmap("Image"),Rect.new(0,0,200,200))
bitmap.draw_text(0,0,200,200,"Food goes here")
This would clear the bitmap of any previous information it might have had. Then it would draw the image "Image", and it would write "Food goes here" on top of the image.
 
Last edited:
Back
Top