Class: DXRubySDL::Font
- Inherits:
-
Object
- Object
- DXRubySDL::Font
- Defined in:
- lib/dxruby_sdl/font.rb
Instance Attribute Summary collapse
-
#_ttf ⇒ Object
readonly
Returns the value of attribute _ttf.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(size, fontname = '', hash = {}) ⇒ Font
constructor
A new instance of Font.
Constructor Details
#initialize(size, fontname = '', hash = {}) ⇒ Font
Returns a new instance of Font.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/dxruby_sdl/font.rb', line 8 def initialize(size, fontname = '', hash = {}) @size = size if !SDL::TTF.init? SDL::TTF.init end if !(path = FONTS[fontname.downcase]) path = FONTS.first.last end @_ttf = SDL::TTF.open(path, size) end |
Instance Attribute Details
#_ttf ⇒ Object (readonly)
Returns the value of attribute _ttf.
6 7 8 |
# File 'lib/dxruby_sdl/font.rb', line 6 def _ttf @_ttf end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
5 6 7 |
# File 'lib/dxruby_sdl/font.rb', line 5 def size @size end |