Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Display Flipped Picture

Display Flipped Picture
Last Update: 2009.03.30
By: Yanfly

Introduction
RPG Maker VX never had an option for pictures to be flipped, which is kinda dumb considering the bitmap property is already there to begin with. All this script does is bind picture flipping to a switch, and if that switch is on, the pictures shown and moved after it will be flipped. If that switch is off, then, well, they’re normal.

Screenshots
pictureflip.jpg


Script
Code:
#===============================================================================

#

# 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.

#

#===============================================================================

#

# Compatibility

# - Alias: Game_Picture, initialize

# - Alias: Game_Picture, show

# - Alias: Game_Picture, 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

  def initialize(number)

    initialize_pictureflip(number)

    @mirror = false

  end

  

  alias show_pictureflip show

  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

  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

  def update

    update_pictureflip

    self.mirror = @picture.mirror

  end

  

end

 

#===============================================================================

#

# END OF FILE

#

#===============================================================================

Instructions
There really isn’t much to teach but here goes. This is something you can change in the modules.

YE::EVENT::SWITCH::PICTURE_FLIP

- This is the switch number that picture flipping will read from.
- By default, this number is 61.

And when you’re editting in the events, this is an example on how to do it.

pictureflip_instructions.jpg


Very simple, right? If you followed that list, then you would have gotten the same thing as those two screenshots up above.

Download the VX-Cutouts
If for whatever reason you don't have the VX-Cutouts and would like them, you can download them here:
http://www.pockethouse.com/rpgvx/VX-Cutouts.rar

Terms and Conditions
Just give credit where due.

Credits and Thanks
-Enterbrain
-Darth Vader

Originally Found Here: http://pockethouse.wordpress.com/vx/display-flipped-picture/
 
Code:
  alias move_pictureflip move

  def move(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)

    show_pictureflip(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)

    @mirror = $game_switches[YE::EVENT::SWITCH::PICTURE_FLIP]

  end

 

it should be:
Code:
  alias move_pictureflip move

  def move(origin, x, y, zoom_x, zoom_y, opacity, blend_type, duration)

    move_pictureflip(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)

    @mirror = $game_switches[YE::EVENT::SWITCH::PICTURE_FLIP]

  end

 
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top