True Flip -- Flip without offset

Actually GD flip any sprite from 0,0 as basic origin…
I wonder if it could be done for any origin position…as standard
so u don’t need to correct the offset after flip…to have a perfect mirroring
that can be achieved only centering the origin…
i dunno maybe i need to call this flip from center…or mirror…i dunno…

…i mean who gonna need an offsetted flip?..

2 Likes

I get what you have in mind
But if you flip object origin and for example you have square dirt image
And you flip it then if you want to create something on that object AFTER flipping
You will create it right from it and not on it

On left you have player created on X position of dirt object and Y - dirt height
Where on right you have the same AFTER you flipped dirt object horizontally

I just want to say i do get how it would benefit some scenarios
But as you see it would generate problems for other scenarios

better have this…(by default…by the engine)
0
and do this later if you need it…(“IF”…when id say…it’s needed)


than “forced” to do this:

And I’ll also say that I don’t even need it…
because I use all my sprites with the origin centered, but how many threads have we seen with offsetted sprites…?

I think those could be avoided, given that 80% of users don’t center the origin.

…and I think it would make the editor more lightweight as well.

another thing… the platform collisions (I hope I’m not saying something wrong here), but I know this issue exists… are calculated from the origin.

Just look at the collision bug …below…
So having the origin at the top‑left , (which could potentially cause a bug that still hasn’t been fixed, and that I’ve known about for the past four years), is not a wise choice, in my opinion…at least…until it’s not fixed…

I am not saying you have bad idea
I just said you fixed one problem by creating another

I personally do see that most ppl would benefit from your idea
Especially new users
But now we would create issue for users who are not new
And as soon as they update engine and launch their older projects
Then they CAN have a lot to modify to adjust the change

I am just saying
We are not in perfect situation here
Where i do see more benefits from your idea than harm

well thaz the only reason indeed

Actually, GDevelop does flip around the center point.

Yes, that’s true, sorry, I didn’t know how to indicate which axis to flip on, the center or the origin …while automatically taking the offset into account…

assuming that’s even possible

I believe RMDB is talking about flipping with axises

For example if i set gun to Player.CenterX()+15 so gun is on right from player
When player animation gets horizontally flipped that +15 should now automatically go +15 but into left
So normally i would need to have other event to check if player is horizontally flipped and go with Player.CenterX()-15

RMDB i think is proposing so it is automatically offsetting based on if player is flipped or not
And not on world position of player

1 Like

Is it feature request for the Sticker behavior?

No… or at least I don’t think so. Actually, I had thought about it… but I’m not sure it would help center the sticker as well. I suggested it only because maybe having the sprite already centered while flipping, without adjusting the offset, could avoid the correction altogether… maybe by automatically calculating the offset from the given origin to the center.

Since sprites are usually where you want em to be, but the origin isn’t…
or the center…again i dunno which one to calculate from…

Edit: Yeah, I also think it could be a good thing for the sticker behavior, if it’s doable.
I just realized we’re basically talking about relative coordinates. I remember Unity had a checkbox like “is relative”… maybe something like that could help here…and i wonder it could be done even outside the sticker

i believe what zero said above is correct…
i just want to get rid of this:

In the end, you’re always the quickest one to get things.