Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Yanfly Engine RD - Display Flipped Picture
- # Last Date Updated: 2009.03.30
- # Level: Easy
- #
- # RPG Maker VX's event editor lacked the ability to flip pictures for some
- # reason. With this script, that should be doable again while staying in the
- # confines of the editor itself. This will save you the need to produce extra
- # copies of a profile cut-out in its mirror form.
- #
- #===============================================================================
- # Instructions
- #===============================================================================
- #
- # There's a switch designated to picture flipping. By default, it's switch 61.
- # If you're already using that switch for something else, just change the value
- # below to reflect which switch you'd like to dedicate picture flipping to.
- #
- # If this switch is ON, the pictures shown and moved following it will flip.
- # If this switch is OFF, following pictures will be shown unflipped like normal.
- #
- #===============================================================================
- # Updates:
- # ----------------------------------------------------------------------------
- # o 2009.03.30 - Started script.
- #===============================================================================
- #
- # Compatibility
- # - Alias: Game_Picture, initialize, show, move
- # - Alias: Sprite_Picture, update
- #
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["DisplayFlippedPicture"] = true
- module YE
- module EVENT
- module SWITCH
- # This is the switch that will flip the next picture displayed if set to
- # true. If it's false, it'll be displayed normally.
- PICTURE_FLIP = 61
- end # module switches
- end # module event
- end # module YE
- #===============================================================================
- # Don't touch anything past here or else your computer will explode and you will
- # be a very sad person.
- #===============================================================================
- #===============================================================================
- # class Game_Picture
- #===============================================================================
- class Game_Picture
- alias initialize_pictureflip initialize unless $@
- def initialize(number)
- initialize_pictureflip(number)
- @mirror = false
- end
- alias show_pictureflip show unless $@
- def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
- show_pictureflip(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
- @mirror = $game_switches[YE::EVENT::SWITCH::PICTURE_FLIP]
- end
- alias move_pictureflip move unless $@
- def move(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)
- move_pictureflip(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)
- @mirror = $game_switches[YE::EVENT::SWITCH::PICTURE_FLIP]
- end
- def mirror
- return @mirror
- end
- end
- #===============================================================================
- # class Sprite_Picture
- #===============================================================================
- class Sprite_Picture < Sprite
- alias update_pictureflip update unless $@
- def update
- update_pictureflip
- self.mirror = @picture.mirror
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement