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.

Printing Numerical Number Based on Variable

Hey guys, I have a question. I am curious if rgss can do the following:

Print a number on screen using the base value from a game variable. I was fooling around with self.contents.draw_text on Scene_Map but couldn't figure it out. Basically I want the following:

If variable 1' numerical value is 'TWO' then the number 2 is printed somewhere on the screen.

Thanks,

Syn.
 
you mean

Variable = 1
self.contents.draw_text(x,y,width,height, Variable.to_s)

To make a variable a string you do that. .to_s

This would also work

1.to_s

About everything can be converted to string.
 

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