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.

About font color...

If in wrong place... sorry. D:

Anyways.

What do I have to add to this:

Code:
if @new_pdef != nil
      self.contents.font.color = normal_color
      self.contents.draw_text(160, 96, 40, 32, "→", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
    end

so I can make the color of the new stat be, let's say green, when a stat is going up with a new equipment. (you know, like from 10 -> 12)
And red when decreasing (12 -> 10)...
Also normal color when the equipment doesn't raise the stat. :/

I suck at explaining so I hope you get what I'm trying to say. xP

Thank you in advance. =D
 
You have to do this above every parameter.

Code:
@actor.pdef == @new_pdef ? self.contents.font.color = normal_color : @actor.pdef < @new_pdef ? 
self.contents.font.color = Color.new(0, 255, 0) : self.contents.font.color = Color.new(255, 0, 0)
self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)

Just exchange the pdef with any other parameter.
 

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