Class: Image

Inherits:
Object
  • Object
show all
Defined in:
bmfont.rb

Overview

Imageクラスに追加するBMFont描画用メソッド

Instance Method Summary (collapse)

Instance Method Details

- (Object) draw_bmfont(x, y, str, bmfont)

BMFontを描画

Parameters:

  • x (Number)

    描画x座標

  • y (Number)

    描画y座標

  • str (String)

    描画文字列

  • bmfont (Object)

    BMFontクラス



127
128
129
130
131
132
133
134
# File 'bmfont.rb', line 127

def draw_bmfont(x, y, str, bmfont)
  str.each_byte do |code|
    x1 = x + bmfont[code].xofs
    y1 = y + bmfont[code].yofs - bmfont.line_height + bmfont.baseofs
    self.draw(x1, y1, bmfont[code].image)
    x += bmfont[code].xadvance + bmfont.spacing
  end
end