self.contents.font.name = "Font Name"
self.contents.font.size = 22
self.contents.font.size = 22
and so on.
But there is a way to merge the different properties into one procedure by adding the following to Window_Base:
#-------------------------------------------
# * Draw font status
# bold : Bold on/off
# italic : Italic on/off
# size : Font size
# color : Font color
#-------------------------------------------
def draw_font(bold, italic, size, color)
# Check bold on/off
case bold
when 0
self.contents.font.bold = false
when 1
self.contents.font.bold = true
end
# Check italic on/off
case italic
when 0
self.contents.font.italic = false
when 1
self.contents.font.italic = true
end
# Change Color
case color
when 0
self.contents.font.color = system_color
when 1
self.contents.font.color = normal_color
when 2
self.contents.font.color = Color.new(255, 255, 255, 255)
end
# Font size
self.contents.font.size = size
endWhenever fonts need to be "drawn", something like this would be called in RGSS when the font and its properties are called:draw_font(1, 0, 22, 1)
This would result in bold 22-size font, set at the default "System Color" (also predefined in the Window_Base).
Other properties can easily be added using the same method. Anything predefined in this way is used as a template for all windows, including the Status and menu screens.






0 Comments So Far:
Post a Comment