Advertisement
DaxSoft

Tdsadaf

Jun 25th, 2014
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. class Spriteset_Map
  2. def pics_sprites
  3. return @picture_sprites
  4. end
  5. end
  6.  
  7. class Scene_Map < Scene_Base
  8. def spriteset
  9. return @spriteset
  10. end
  11. end
  12.  
  13.  
  14.  
  15. class Sprite_Picture < Sprite
  16.  
  17. alias :correction_update :update
  18.  
  19. def update
  20. return if picture_erased?
  21. correction_update
  22. end
  23.  
  24. def picture_erased?
  25. return false unless @picture.name == ""
  26. unless self.bitmap.nil?
  27. self.bitmap.dispose
  28. self.bitmap = nil
  29. end
  30. return true
  31. end
  32.  
  33. def transparent?(x, y, of_screen=true)
  34. return if self.bitmap.nil?
  35. result = true
  36. if da_tela
  37. if !x.nil?
  38. x -= self.x
  39. x += 43 if $game_variables[11] != 2
  40. end
  41. if !y.nil?
  42. y -= self.y
  43. y += 39
  44. end
  45. end
  46. if (x.nil?)
  47. for x in 0..(self.bitmap.width)
  48. result = false if self.bitmap.get_pixel(x, y).alpha != 0
  49. end
  50. end
  51. if (y.nil?)
  52. for y in 0..(self.bitmap.height)
  53. result = false if self.bitmap.get_pixel(x, y).alpha != 0
  54. end
  55. end
  56. result = false if !x.nil? and !y.nil? and self.bitmap.get_pixel(x, y).alpha != 0
  57. return result
  58. end
  59.  
  60. end
  61.  
  62. class Game_Interpreter
  63. def click_transparente?(n, x, y)
  64. return false if SceneManager.scene.spriteset.pics_sprites[n].nil?
  65. return SceneManager.scene.spriteset.pics_sprites[n].transparent?(x, y)
  66. end
  67.  
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement