Go Back   The PokéCommunity Forums > Creative Discussions > Game Development
Reload this Page [Question] Draw_text over pictures?

Notices
For all updates, view the main page.

Game Development Your number one stop for anything related to creating games (except ROM hacks). You can even make your own!



Reply
 
Thread Tools
  #1    
Old March 19th, 2014 (02:57 AM).
Alesteir Alesteir is offline
 
Join Date: Oct 2013
Gender: Male
Posts: 60
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
Reply With Quote
  #2    
Old March 19th, 2014 (10:35 AM). Edited March 19th, 2014 by Luka S.J..
Luka S.J.'s Avatar
Luka S.J. Luka S.J. is offline
@LukaSJ0
 
Join Date: Dec 2008
Location: Croatia
Age: 21
Gender: Male
Nature: Adamant
Posts: 834
Quote originally posted by Alesteir:
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.
__________________
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 11:26 PM.