Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Spriteset_Map
- def pics_sprites
- return @picture_sprites
- end
- end
- class Scene_Map < Scene_Base
- def spriteset
- return @spriteset
- end
- end
- class Sprite_Picture < Sprite
- alias :correction_update :update
- def update
- return if picture_erased?
- correction_update
- end
- def picture_erased?
- return false unless @picture.name == ""
- unless self.bitmap.nil?
- self.bitmap.dispose
- self.bitmap = nil
- end
- return true
- end
- def transparent?(x, y, of_screen=true)
- return if self.bitmap.nil?
- result = true
- if da_tela
- if !x.nil?
- x -= self.x
- x += 43 if $game_variables[11] != 2
- end
- if !y.nil?
- y -= self.y
- y += 39
- end
- end
- if (x.nil?)
- for x in 0..(self.bitmap.width)
- result = false if self.bitmap.get_pixel(x, y).alpha != 0
- end
- end
- if (y.nil?)
- for y in 0..(self.bitmap.height)
- result = false if self.bitmap.get_pixel(x, y).alpha != 0
- end
- end
- result = false if !x.nil? and !y.nil? and self.bitmap.get_pixel(x, y).alpha != 0
- return result
- end
- end
- class Game_Interpreter
- def click_transparente?(n, x, y)
- return false if SceneManager.scene.spriteset.pics_sprites[n].nil?
- return SceneManager.scene.spriteset.pics_sprites[n].transparent?(x, y)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement