class ClippableSprite < Sprite_Character def initialize(viewport,event,tilemap) @tilemap = tilemap @_src_rect = Rect.new(0,0,0,0) super(viewport,event) end def update super @_src_rect = self.src_rect tmright = @tilemap.map_data.xsize*Game_Map::TILE_WIDTH-@tilemap.ox echoln("x=#{self.x},ox=#{self.ox},tmright=#{tmright},tmox=#{@tilemap.ox}") if @tilemap.ox-self.ox<-self.x # clipped on left diff = -self.x-@tilemap.ox+self.ox self.src_rect = Rect.new(@_src_rect.x+diff,@_src_rect.y, @_src_rect.width-diff,@_src_rect.height) echoln("clipped out left: #{diff} #{@tilemap.ox-self.ox} #{self.x}") elsif tmright-self.ox0 @weather.max -= 2 if @weather.max<=0 @weather.max = 0 @weather.type = 0 @weather.ox = 0 @weather.oy = 0 end end else @weather.type = $game_screen.weather_type @weather.max = $game_screen.weather_max @weather.ox = tmox @weather.oy = tmoy end @weather.update @@viewport1.tone = $game_screen.tone @@viewport3.color = $game_screen.flash_color @@viewport1.update @@viewport3.update end end