class Font
Attributes
default_bold[RW]
default_color[RW]
default_italic[RW]
default_name[RW]
default_out_color[RW]
default_outline[RW]
default_shadow[RW]
default_size[RW]
bold[RW]
color[RW]
italic[RW]
name[RW]
out_color[RW]
outline[RW]
shadow[RW]
size[RW]
Public Class Methods
exist?(name)
click to toggle source
# File lib/rgss3/font.rb, line 10 def exist?(name) f = (Gosu::Font.new(Graphics.gosu_window, "./Fonts/#{name}.ttf", 8) rescue false) Gosu::Font.new(Graphics.gosu_window, name, 8) unless f return true rescue return false end
new(name = Font.default_name, size = Font.default_size)
click to toggle source
# File lib/rgss3/font.rb, line 30 def initialize(name = Font.default_name, size = Font.default_size) @name = name.dup @size = size @bold = Font.default_bold @italic = Font.default_italic @shadow = Font.default_shadow @outline = Font.default_outline @color = Font.default_color.dup @out_color = Font.default_out_color.dup end
Public Instance Methods
first_existant_name()
click to toggle source
NEW
# File lib/rgss3/font.rb, line 43 def first_existant_name if @name.is_a?(Array) @name.each {|a| return a if Font.exist?(a) } else return @name if Font.exist?(@name) end return "Verdana" end