RubyからDirectXを使うための拡張ライブラリ
各機能を使うためのクラス
クラス | 機能 |
Windowクラス | ウィンドウの管理 |
Resourceクラス | バイナリデータの読み込み |
Graphicsクラス | DirectGraphicsの利用 |
Inputクラス | DirectInputの利用 |
Soundクラス | DirectSoundの利用 |
# 絵をテクスチャに登録 @graphics.regist_texture(texture_id, data) # テクスチャの一部をスプライトに登録 @graphics.regist_sprite(sprite_id, texture_id, x, y, width, height) # スプライトの描画 @graphics.draw_sprite(sprite_id, x, y, z)
# 入力の情報を更新 @input.update if @input.down?('key left') or @input.down?('joy left') then # 左矢印キーかパッドの左が # 押されたときの処理 end
# サウンドのデータを読み込む @sound.load(id, data) # 読み込んだサウンドを再生 @sound.play(id, with_loop)