Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: ShadowSaber on April 20, 2011, 01:30:57 am

Title: [Resolved] Flip Graphics in Game
Post by: ShadowSaber on April 20, 2011, 01:30:57 am
One more question,

I want to know how to flip character graphic in game

THanks ~

-----edit : resolved-----
Title: Re: Flip Graphics in Game
Post by: ForeverZer0 on April 20, 2011, 01:35:18 am
Actually, the easiest way would be to just get a charset with the graphics flipped, then use an event to change the graphic.
Title: Re: Flip Graphics in Game
Post by: ShadowSaber on April 20, 2011, 01:43:41 am
Quote from: ForeverZer0 on April 20, 2011, 01:35:18 am
Actually, the easiest way would be to just get a charset with the graphics flipped, then use an event to change the graphic.


it's the easiest method but... what should i say...

I wanted to do it with a script to reduce graphics needed

I want to use it for all event in certain map,
to create flipped version on each graphics will increase a lot of size
Title: Re: Flip Graphics in Game
Post by: Zeriab on April 20, 2011, 01:51:36 am
If you have light coming from a specific angle simply mirroring the graphic may not look right.
Consider if this is the case for the character graphics you want flipped because you'd get a better result spriting the flipped character to reflect the light.

*hugs*
Title: Re: Flip Graphics in Game
Post by: ForeverZer0 on April 20, 2011, 02:25:22 am

class Scene_Map
 attr_accessor :spriteset
end

class Spriteset_Map
 attr_accessor :character_sprites
end

module ShadowSaber
 
 def self.flip
   $scene.spriteset.character_sprites.each {|chr| chr.angle += 180 }
 end
end


Just use the script call "ShadowSaber.flip"

This is about as down and dirty as it gets. With a couple more minutes, it could actually be scripted properly...
Title: Re: Flip Graphics in Game
Post by: Blizzard on April 20, 2011, 02:44:23 am
Isn't that rotation by 180 and not flipping? Under flipping I'd understand a horizontal or a vertical flip. There's always Sprite#mirror that can be set to true in that case.
Title: Re: Flip Graphics in Game
Post by: ForeverZer0 on April 20, 2011, 02:48:34 am
Yeah, but as far as mirroring goes on character sprite, its basically just the sprite facing the opposite direction. I kind of assumed he meant vertically.
ShadowSaber?
Title: Re: Flip Graphics in Game
Post by: Ryex on April 20, 2011, 02:52:05 am
a true vertical flip would rotate 180 AND mirror it
Title: Re: Flip Graphics in Game
Post by: ForeverZer0 on April 20, 2011, 02:56:25 am
oooooh, and the shit just got deeper....  :haha:
Title: Re: Flip Graphics in Game
Post by: LiTTleDRAgo on April 20, 2011, 07:12:50 am
-----removed-----
Title: Re: Flip Graphics in Game
Post by: Blizzard on April 20, 2011, 07:16:16 am
One-liners, ew.
Title: Re: Flip Graphics in Game
Post by: ShadowSaber on April 20, 2011, 09:28:21 am
thanks drago  :haha: