=begin  ピクチャー拡張 ver 0.0.0.1         by 半生 http://www.tktkgame.com/ http://www11.atpages.jp/namahanka/ ピクチャー表示機能を拡張します。 ・Game_Picture.set_hook(pic_no, flag=true)  pic_no番のピクチャーをマップ座標で表示するようにします。 ・Game_Picture.reset_pos_ajust(pic_no=-1)  pic_no番のピクチャーをスクリーン座標に戻す。  引数を省略した場合は全ピクチャをスクリーン座標表示に戻す。 ・Game_Picture.set_mirror(pic_no, flag)  pic_no番のピクチャーを左右反転するかどうか指定する ver 0.0.0.1 (2010/08/04)  公開 =end class Game_Picture attr_accessor :hook attr_accessor :mirror # クラスメソッド # pic_noのピクチャーのマップ座標フラグを設定する def self.set_hook(pic_no, flag=true) return if $game_temp.in_battle if pic_no.between?(0,19) $game_map.screen.pictures[pic_no].hook = flag end end # pic_noのピクチャーのマップ座標フラグをリセットする def self.reset_pos_ajust(pic_no=-1) return if $game_temp.in_battle if pic_no < 0 for i in 0...20 $game_map.screen.pictures[i].hook = false end elsif pic_no.between?(0,19) $game_map.screen.pictures[pic_no].hook = false end end # pic_noのピクチャーの左右反転フラグを設定する def self.set_mirror(pic_no, flag=true) if pic_no.between?(0,19) if $game_temp.in_battle $game_troop.screen.pictures[pic_no].mirror = flag else $game_map.screen.pictures[pic_no].mirror = flag end end end # インスタンスメソッド alias :_hn_expic__initialize :initialize unless private_method_defined?(:_hn_expic__initialize) def initialize(*args) _hn_expic__initialize(*args) @hook = false @mirror = false end # 画面座標からマップ座標へ def scr2map_xy(mx=@x, my=@y) return if $game_temp.in_battle @x = (mx - $game_map.adjust_x(0) / 8) % ($game_map.width * 32) @y = (my - $game_map.adjust_y(0) / 8) % ($game_map.height * 32) end end class Sprite_Picture # 更新 # 左右反転処理を追加 alias :_hn_expic__update :update def update _hn_expic__update if self.visible # マップ固定判定 if @picture.hook and !$game_temp.in_battle self.x = $game_map.adjust_x(@picture.x * 8) / 8 self.y = $game_map.adjust_y(@picture.y * 8) / 8 end # 左右反転判定 self.mirror = (@picture.mirror == true) end end end