Advertisement
Kyriaki

Yanfly Engine RD - Display Flipped Picture

Apr 27th, 2011
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.59 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # Yanfly Engine RD - Display Flipped Picture
  4. # Last Date Updated: 2009.03.30
  5. # Level: Easy
  6. #
  7. # RPG Maker VX's event editor lacked the ability to flip pictures for some
  8. # reason. With this script, that should be doable again while staying in the
  9. # confines of the editor itself. This will save you the need to produce extra
  10. # copies of a profile cut-out in its mirror form.
  11. #
  12. #===============================================================================
  13. # Instructions
  14. #===============================================================================
  15. #
  16. # There's a switch designated to picture flipping. By default, it's switch 61.
  17. # If you're already using that switch for something else, just change the value
  18. # below to reflect which switch you'd like to dedicate picture flipping to.
  19. #
  20. # If this switch is ON, the pictures shown and moved following it will flip.
  21. # If this switch is OFF, following pictures will be shown unflipped like normal.
  22. #
  23. #===============================================================================
  24. # Updates:
  25. # ----------------------------------------------------------------------------
  26. # o 2009.03.30 - Started script.
  27. #===============================================================================
  28. #
  29. # Compatibility
  30. # - Alias: Game_Picture, initialize, show, move
  31. # - Alias: Sprite_Picture, update
  32. #
  33. #===============================================================================
  34.  
  35. $imported = {} if $imported == nil
  36. $imported["DisplayFlippedPicture"] = true
  37.  
  38. module YE
  39.   module EVENT
  40.     module SWITCH
  41.      
  42.       # This is the switch that will flip the next picture displayed if set to
  43.       # true. If it's false, it'll be displayed normally.
  44.       PICTURE_FLIP = 61
  45.      
  46.     end # module switches
  47.   end # module event
  48. end # module YE
  49.  
  50. #===============================================================================
  51. # Don't touch anything past here or else your computer will explode and you will
  52. # be a very sad person.
  53. #===============================================================================
  54.  
  55. #===============================================================================
  56. # class Game_Picture
  57. #===============================================================================
  58.  
  59. class Game_Picture
  60.  
  61.   alias initialize_pictureflip initialize unless $@
  62.   def initialize(number)
  63.     initialize_pictureflip(number)
  64.     @mirror = false
  65.   end
  66.  
  67.   alias show_pictureflip show unless $@
  68.   def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
  69.     show_pictureflip(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
  70.     @mirror = $game_switches[YE::EVENT::SWITCH::PICTURE_FLIP]
  71.   end
  72.  
  73.   alias move_pictureflip move unless $@
  74.   def move(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)
  75.     move_pictureflip(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)
  76.     @mirror = $game_switches[YE::EVENT::SWITCH::PICTURE_FLIP]
  77.   end
  78.  
  79.   def mirror
  80.     return @mirror
  81.   end
  82.  
  83. end
  84.  
  85. #===============================================================================
  86. # class Sprite_Picture
  87. #===============================================================================
  88.  
  89. class Sprite_Picture < Sprite
  90.  
  91.   alias update_pictureflip update unless $@
  92.   def update
  93.     update_pictureflip
  94.     self.mirror = @picture.mirror
  95.   end
  96.  
  97. end
  98.  
  99. #===============================================================================
  100. #
  101. # END OF FILE
  102. #
  103. #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement