How do I scale a rotated sprite along the screen Y-axis and not the rotated axis?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Substr

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

Have you tried global_scale?

Magso | 2020-02-15 16:46

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.

Substr | 2020-02-15 16:51

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.

denxi | 2020-02-15 16:54

:bust_in_silhouette: Reply From: MAKMan

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