Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Draw_text with event script

Hey, I was trying to do a very simple thing that would allow me to draw text over the player or event objects, but this RGSS and I was wondering how I would use built in variables(not Rgss but rmxp built in)

Example:


Code:
 draw_text(XXX:HeroX, XXX:HeroY, XXX:damage)

then like y = y + 1;

This may sound like a ruby question, and it is.. but this isn't a script more like a command instead of splitting variables then making a top of branch commands to show a picture.

Oh.. and after wait 5 frames the text that was draw fades away.

If anyone can help that'd be awesome!
 

Atoa

Member

First you would need to create an new bitmap where the text would be drawn.
E.g.:
@map_text = Bitmap.new

Then use the draw_text on this bitmap:
E.g.:
@map_text.draw_text(x, y, width, height, text, alingment)

to get actors x/y postion you can use "$game_player.x" "$game_player.y"
 
Atoa":3ga10vhc said:
First you would need to create an new bitmap where the text would be drawn.
E.g.:
@map_text = Bitmap.new

Then use the draw_text on this bitmap:
E.g.:
@map_text.draw_text(x, y, width, height, text, alingment)

to get actors x/y postion you can use "$game_player.x" "$game_player.y"

Ah cool, so for like event's it'd be game_variables[XXX]?
 
Note that $game_player.x and $game_player.y is the player's tile position. Meaning that it would, in this case, not work for positioning your text. You would have to use $game_player.screen_x and $game_player.screen_y.

As for your question about game_variables[XXX] I don't quite follow. Could you be more specific?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top