#============================================================================== # ■ Bitmap #============================================================================== class Bitmap #-------------------------------------------------------------------------- # ● ピクチャ描画(Graphics/Pictures内の画像を表示) # file_name : 画像ファイル名 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_picture(file_name, x, y) bitmap = RPG::Cache.picture(file_name) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) blt(x, y, bitmap, src_rect) end end class Bitmap #-------------------------------------------------------------------------- # ● アイコン描画(Graphics/Icons内の画像を表示) # file_name : 画像ファイル名 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_icon(file_name, x, y) bitmap = RPG::Cache.icon(file_name) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) blt(x, y, bitmap, src_rect) end end class Bitmap #-------------------------------------------------------------------------- # ● バトラー描画(Graphics/Battlers内の画像を表示) # file_name : 画像ファイル名 # x : 描画先 X 座標 # y : 描画先 Y 座標 # hue : 色相変化値(省略可) #-------------------------------------------------------------------------- def draw_battler(file_name, x, y, hue = 0) bitmap = RPG::Cache.battler(file_name, hue) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) blt(x, y, bitmap, src_rect) end end class Bitmap #-------------------------------------------------------------------------- # ● ゲージ表示 # x : 描画先 X 座標 # y : 描画先 Y 座標 # current : 表示率(%) # file : 表示ファイル名(Graphics/picture) #-------------------------------------------------------------------------- def draw_bar(x, y, current, file) bitmap = RPG::Cache.picture(file) cw = bitmap.width * current / 100 ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) blt(x, y, bitmap, src_rect) end end