class Gosu::Font

Attributes

flags[R]
name[R]

Public Class Methods

new(window, font_name, font_height, font_flags = :ff_bold) click to toggle source
# File lib/gosu_android/graphics/font.rb, line 30
def initialize(window, font_name, font_height, font_flags = :ff_bold)
  @window = window
  @fonts_manager = window.fonts_manager
  @name = font_name
  @height = font_height * 2
  @flags = flags
end

Public Instance Methods

draw(text, x, y, z, factor_x = 1, factor_y = 1, c = Color::WHITE, mode = :default) click to toggle source

Draws text so the top left corner of the text is at (x; y). param text Formatted text without line-breaks.

# File lib/gosu_android/graphics/font.rb, line 44
def draw(text, x, y, z, factor_x = 1, factor_y = 1, c = Color::WHITE,
  mode = :default)

  offset = 0
  text.each_char do |char|
    (@fonts_manager.getSymbol char ).draw(x + offset, y, z, factor_x, factor_y, c, mode)
    offset += 10
  end

end
height() click to toggle source
# File lib/gosu_android/graphics/font.rb, line 38
def height
  @height / 2
end