This seems like it should be a remarkably easy thing to solve. But for some reason it's stumping me.
I have a sprite. This sprite might be scaled, rotated, or otherwise transformed in any way.
Now, I want to further stretch (scale) this sprite along the
x axis of the screen (i.e. stretch left and right) regardless of the sprite's orientation. I do not want to stretch along the x axis of the sprite itself.
Simply calling this:
sf::Sprite::scale(scaleFactor, 1.f)
doesn't work, because it would only stretch in the proper direction if the sprite was non-rotated. For example, if I turned the sprite 90 degrees, then it would now be stretched on the screen y axis. I always want the stretching on the screen x axis.
In other words, the sf::Sprite::scale function works as a local-space scaling factor. I need a world-space scaling factor.
Is there something simple I can do with an sf::Transform here? It's no problem if I have to perform a per-frame function call to accomplish this, to account for a rotating sprite.
It seems like I'm missing something obvious.
Thanks!