+2 votes

I'm trying to work out how to programatically apply Y-axis scaling to a sprite that has been rotated, but apply the scaling along the original/screen axis and not the rotated local one.

I've tried various combinations of modifying rotation_degreesand scale or using a Transform2D to attempt to apply the rotation and then scale in order, but nothing seems to give the result I want. I've included some badly drawn diagrams to try and explain what I'm after, using an example of a square and a 45 degree rotation. I may be missing something obvious but I'd appreciate any pointers in the right direction to get the intended result.

What I currently get:
enter image description here

What I want:
enter image description here

asked Feb 15 in Engine by Substr (14 points)

Have you tried global_scale?

Yeah, I tried that too though I don't fully understand what the difference is, as it gives the same result as the first picture.

What if you put the sprite inside a parent node2d. Only apply rotation to the sprite, but when you scale, change the y scaling of the parent node.

It's more of a workaround than a real answer, but it might work.

1 Answer

0 votes

So you could just extend the y axis but it will make it more squished looking. Making a new sprite might also be necessary.

answered Feb 16 by MAKMan (19 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.