LoginLogin

flip sprites horizontally & Vertically

Root / Programming Questions / [.]

Z_E_R_OCreated:
could someone explain how to flip sprites without using spdef

Like in the sprite sheet editor? The only other way I know of is to use flipped sprite data (mess with arrays or create a new sprite).

Like in the sprite sheet editor? The only other way I know of is to use flipped sprite data (mess with arrays or create a new sprite).
Could you show me how to use sprite data to flip it without creating a flipped version of the sprite please?

in a 3d test I used #SPREVH or #SPREVV (horizontal or vertical) Like for evample SPSET 0,64,0,16,16,1+#SPREVH That uh should be all.. the spset might not be right but it gives an example atleast for how it would go...

in a 3D test I used #SPREVH or #SPREVV (Flip horizontally or vertically) For example SPSET 0,64,0,16,16,1+#SPREVH That uh should be all.. the SPSET might not be right but it gives an example at least for how it would go...
You need a SPDEFined sprite template 0 with UV coordinates U=0 V=0, the size of the sprite should be W=16 H=16, the origin OX=8 OY=16, and it must be visible and flipped horizontally?
SPDEF 0,0,0,16,16,8,16,#SPREVH+1
If width, height and origin should be left out, you can do so. Here you go.
You could do this like so, too.
SPSET 0,0,0,16,16,#SPREVH+1
SPHOME 8,16
If you need to change the flip on the fly, you can use SPCHR to change the attributes (like flipping).

You can also use a negative scale to flip sprites, but smileboom messed up and you have to use SPANIM rather than SPSCALE:
'flip horizontally:
SPANIM id,"S",1, -1,0
'flip vertically:
SPANIM id,"S",1, 0,-1

ive been experementing with all the post you guys have made and they work. Thank you! The reason i need this info is because im making a battle system where when the enemy attacks you there is no transition and the battle takes place where you stand. so I needed to be able to flip the enemy sprites. Thank you!