Class: EhbGameLib::Text::BitmapFont

Inherits:
Object
  • Object
show all
Defined in:
lib/ehb_game_lib/text/bitmap_font.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, line_height) ⇒ BitmapFont

Returns a new instance of BitmapFont.



8
9
10
11
# File 'lib/ehb_game_lib/text/bitmap_font.rb', line 8

def initialize(name, line_height)
  @name = name
  @line_height = line_height
end

Instance Attribute Details

#line_heightObject (readonly)

Returns the value of attribute line_height.



6
7
8
# File 'lib/ehb_game_lib/text/bitmap_font.rb', line 6

def line_height
  @line_height
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/ehb_game_lib/text/bitmap_font.rb', line 6

def name
  @name
end

Instance Method Details

#image(text) ⇒ Object



13
14
15
# File 'lib/ehb_game_lib/text/bitmap_font.rb', line 13

def image(text)
  ::Gosu::Image.from_text(text, line_height, retro: true, font: name)
end