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.

Font Color

Status
Not open for further replies.

Anonymous

Guest

self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, text, 2)


This is the line I see everywhere, and so I think it is the one that deals with the font's color.....

So what do I do to change the color of the font?
 

$t3v0

Awesome Bro

i'm guessing it's after the "font.color ="

Try putting "#000000" or just "000000" Which will show black.

Alternatively, use the RGB values ... so put "000" or "0,0,0" which is also black, just a using a different approach.
 

Anonymous

Guest

################
# Window_Gold2 #
################
class Window_Gold2 < Window_Base
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
cx = contents.text_size($data_system.words.gold).width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.gold.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
end
end

*What you're saying may be what I need to do, however I tried a few things, and got syntax every time, so here's the whol part of the script.....

Any other ideas, cause I'm fresh out.....
 

ccoa

Member

If you just want to change the color of this window, change the line

self.contents.font.color = normal_color

to

self.contents.font.color = Color.new(r, g, b, a)

where r, g, b, and a are the red, green, blue, and alpha values of the new color, respectively. For example, to make the color opaque black:

self.contents.font.color = Color.new(0, 0, 0, 255)

To change the color that normal_color is (white by default), find this method in Window_Base:

Code:
  #--------------------------------------------------------------------------
  # * Get Normal Text Color
  #--------------------------------------------------------------------------
  def normal_color
    return Color.new(255, 255, 255, 255)
  end

and change the color.
 

ccoa

Member

This topic has been resolved. If Calintz16438 or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

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