Module: Window

Defined in:
bdffont.rb

Overview

Windowクラスに追加するBDFフォント描画用メソッド

Class Method Summary (collapse)

Class Method Details

+ (Object) draw_bdffont(x, y, str, bdf, z = 0)

BDFフォントを描画

Parameters:

  • x (Number)

    描画x座標

  • y (Number)

    描画y座標

  • str (String)

    描画文字列

  • bdf (Object)

    BDFフォントクラス

  • z (Integer) (defaults to: 0)

    描画優先順位



332
333
334
335
336
337
338
339
340
# File 'bdffont.rb', line 332

def self.draw_bdffont(x, y, str, bdf, z = 0)
  str.split('').each do |code|
    b = bdf[code]
    unless b == nil
      Window.draw(x + b.ofsx, y - b.ofsy, b.image, z)
      x += b.dwidth
    end
  end
end