[SOLVED] Flipping a sprite in DECORATE.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- ::Bloodfury::
- Posts: 332
- Joined: Mon Aug 01, 2011 7:39 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Finland
[SOLVED] Flipping a sprite in DECORATE.
Hey!
I have multiple different objects.
And for variety reasons, I would like to Know can you define a sprite frame so it is mirrored?
I would like to use the same graphic creating a new imagelump from the mirrored graphic to be aligned.
I want to save time and not fill my folders with mirrored duplicate images of static objects.
Probably my eye just did not catch this at wiki.
I have multiple different objects.
And for variety reasons, I would like to Know can you define a sprite frame so it is mirrored?
I would like to use the same graphic creating a new imagelump from the mirrored graphic to be aligned.
I want to save time and not fill my folders with mirrored duplicate images of static objects.
Probably my eye just did not catch this at wiki.
Last edited by ::Bloodfury:: on Fri May 12, 2017 9:04 am, edited 1 time in total.
Re: Flipping a sprite in DECORATE.
Well there's the old trick of giving the actor a negative scale.
There's also a new SPRITEFLIP flag that requires a development version.
There's also a new SPRITEFLIP flag that requires a development version.
- ::Bloodfury::
- Posts: 332
- Joined: Mon Aug 01, 2011 7:39 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Finland
Re: Flipping a sprite in DECORATE.
So I would just type TNT1 A -1 and that would mirror the sprite?
- Jekyll Grim Payne
- Global Moderator
- Posts: 1120
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
- Contact:
Re: Flipping a sprite in DECORATE.
That's length, it has nothing to do with scale.::Bloodfury:: wrote:So I would just type TNT1 A -1 and that would mirror the sprite?
Code: Select all
TNT1 A 0 A_SetScale(scalex*(-1),scaley)
Re: Flipping a sprite in DECORATE.
As Gez said, you can use +SPRITEFLIP for this. That also has the advantage of using correct rotations, where "ScaleX -1" will not do that. It does, however, require devbuilds to do this.
If you want to do this dynamically (i.e. random for every object) you can use the following code:
If you want to do this dynamically (i.e. random for every object) you can use the following code:
Code: Select all
states
{
Spawn:
TNT1 A 0
OBJC A -1 A_ChangeFlag("SPRITEFLIP", random(0,1))
}
- ::Bloodfury::
- Posts: 332
- Joined: Mon Aug 01, 2011 7:39 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Finland
Re: Flipping a sprite in DECORATE.
I would like to stay in the official builds. So thus
EDIT: It is not.
This would be the way to go?Code: Select all
TNT1 A 0 A_SetScale(scalex*(-1),scaley)
EDIT: It is not.
Re: Flipping a sprite in DECORATE.
Post the full code.
- ::Bloodfury::
- Posts: 332
- Joined: Mon Aug 01, 2011 7:39 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Finland
Re: Flipping a sprite in DECORATE.
I don't currently have any code. I will create lot's of static objects. Candles, skulls etc. And I just would like to know how to mirror the sprite, without using a duplicate image which is flipped.
Since every mirrored objects graphic must be aligned, etc.
But for example, if we would to be use this Hexens hanging ceiling moss. How would you flip the sprite, without creating a completely new graphic.
Since every mirrored objects graphic must be aligned, etc.
But for example, if we would to be use this Hexens hanging ceiling moss. How would you flip the sprite, without creating a completely new graphic.
Code: Select all
ACTOR ZMossCeiling1 //this would be the original.
{
Radius 20
Height 20
+SPAWNCEILING
+NOGRAVITY
States
{
Spawn:
MSS1 A -1
Stop
}
}
ACTOR MirroredZMossCeiling1 //And this would be mirrored.
{
Radius 20
Height 20
+SPAWNCEILING
+NOGRAVITY
States
{
Spawn:
MSS1 A -1 //So something has to be done here.
Stop
}
}
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: Flipping a sprite in DECORATE.
Actually, it doesn't. You can set the actor's scale as one of its properties, meaning that all you need is:
This is ignoring the fact that if you use UDMF for your map, you can set the actor's scale right on the map, meaning you don't even need to create a new actor.
Code: Select all
ACTOR MirroredZMossCeiling1 : ZMossCeiling1 { XScale -1.0 }
- ::Bloodfury::
- Posts: 332
- Joined: Mon Aug 01, 2011 7:39 pm
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Finland
Re: Flipping a sprite in DECORATE.
Yeah I'm using UDMF and indeed the actor scale could be manipulated right in the editor! I don't see why anyone would use any other map format these days.
Except vanilla maps. But hey. This solves the issue! Thank you so very much kind people!
And the best part is by far that I do not need to create a duplicate actor!
Except vanilla maps. But hey. This solves the issue! Thank you so very much kind people!
