Class: Font
- Inherits:
-
Object
- Object
- Font
- Defined in:
- lib/rgss3/font.rb
Class Attribute Summary collapse
-
.default_bold ⇒ Object
Returns the value of attribute default_bold.
-
.default_color ⇒ Object
Returns the value of attribute default_color.
-
.default_italic ⇒ Object
Returns the value of attribute default_italic.
-
.default_name ⇒ Object
Returns the value of attribute default_name.
-
.default_out_color ⇒ Object
Returns the value of attribute default_out_color.
-
.default_outline ⇒ Object
Returns the value of attribute default_outline.
-
.default_shadow ⇒ Object
Returns the value of attribute default_shadow.
-
.default_size ⇒ Object
Returns the value of attribute default_size.
Instance Attribute Summary collapse
-
#bold ⇒ Object
Returns the value of attribute bold.
-
#color ⇒ Object
Returns the value of attribute color.
-
#italic ⇒ Object
Returns the value of attribute italic.
-
#name ⇒ Object
Returns the value of attribute name.
-
#out_color ⇒ Object
Returns the value of attribute out_color.
-
#outline ⇒ Object
Returns the value of attribute outline.
-
#shadow ⇒ Object
Returns the value of attribute shadow.
-
#size ⇒ Object
Returns the value of attribute size.
Class Method Summary collapse
Instance Method Summary collapse
-
#first_existant_name ⇒ Object
NEW.
-
#initialize(name = Font.default_name, size = Font.default_size) ⇒ Font
constructor
A new instance of Font.
Constructor Details
#initialize(name = Font.default_name, size = Font.default_size) ⇒ Font
Returns a new instance of Font.
30 31 32 33 34 35 36 37 38 39 |
# 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 |
Class Attribute Details
.default_bold ⇒ Object
Returns the value of attribute default_bold.
6 7 8 |
# File 'lib/rgss3/font.rb', line 6 def default_bold @default_bold end |
.default_color ⇒ Object
Returns the value of attribute default_color.
8 9 10 |
# File 'lib/rgss3/font.rb', line 8 def default_color @default_color end |
.default_italic ⇒ Object
Returns the value of attribute default_italic.
7 8 9 |
# File 'lib/rgss3/font.rb', line 7 def default_italic @default_italic end |
.default_name ⇒ Object
Returns the value of attribute default_name.
6 7 8 |
# File 'lib/rgss3/font.rb', line 6 def default_name @default_name end |
.default_out_color ⇒ Object
Returns the value of attribute default_out_color.
8 9 10 |
# File 'lib/rgss3/font.rb', line 8 def default_out_color @default_out_color end |
.default_outline ⇒ Object
Returns the value of attribute default_outline.
7 8 9 |
# File 'lib/rgss3/font.rb', line 7 def default_outline @default_outline end |
.default_shadow ⇒ Object
Returns the value of attribute default_shadow.
7 8 9 |
# File 'lib/rgss3/font.rb', line 7 def default_shadow @default_shadow end |
.default_size ⇒ Object
Returns the value of attribute default_size.
6 7 8 |
# File 'lib/rgss3/font.rb', line 6 def default_size @default_size end |
Instance Attribute Details
#bold ⇒ Object
Returns the value of attribute bold.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def bold @bold end |
#color ⇒ Object
Returns the value of attribute color.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def color @color end |
#italic ⇒ Object
Returns the value of attribute italic.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def italic @italic end |
#name ⇒ Object
Returns the value of attribute name.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def name @name end |
#out_color ⇒ Object
Returns the value of attribute out_color.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def out_color @out_color end |
#outline ⇒ Object
Returns the value of attribute outline.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def outline @outline end |
#shadow ⇒ Object
Returns the value of attribute shadow.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def shadow @shadow end |
#size ⇒ Object
Returns the value of attribute size.
28 29 30 |
# File 'lib/rgss3/font.rb', line 28 def size @size end |
Class Method Details
.exist?(name) ⇒ Boolean
10 11 12 13 14 15 16 |
# 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 |