RGSS Tips @Wiki
ピクチャに角度機能を実装
最終更新:
匿名ユーザー
-
view
#==============================================================================
# ■ Game_Picture
#==============================================================================
class Game_Picture
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :angle
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias ここに半角小文字の英字で適当な文字列を入れる_initialize initialize
def initialize(number)
上のと同じ文字列を入れる_initialize(number) # 名前を変えた initialize を呼び出す
@angle = 0
end
#--------------------------------------------------------------------------
# ● ピクチャの消去
#--------------------------------------------------------------------------
alias ここに半角小文字の英字で適当な文字列を入れる_erase erase
def erase
上のと同じ文字列を入れる_erase # 名前を変えた erase を呼び出す
@angle = 0
end
end
#==============================================================================
# ■ Sprite_Picture
#==============================================================================
class Sprite_Picture < Sprite
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias ここに半角小文字の英字で適当な文字列を入れる_update update
def update
上のと同じ文字列を入れる_update # 名前を変えた update を呼び出す
self.angle = @picture.angle
end
end
# イベントコマンドのスクリプト # 0~360度で指定 $game_screen.pictures[ピクチャ番号].angle = 180