SFML community forums

Help => Graphics => Topic started by: thoniel on August 01, 2009, 10:03:26 pm

Title: rotating and THEN scaling sprite
Post by: thoniel on August 01, 2009, 10:03:26 pm
hi
i wanted to rotate a sprite by 45 degrees and then scale it down in the height to get a isometric-sort-of tile.

but if i do that directly by sprite.rotate and sprite.scale, it seems that it order is always scale and then rotate. (which sort of makes sense).

is there any possibility how i can modify directly an image or something like this to get what i need?
Title: rotating and THEN scaling sprite
Post by: Laurent on August 01, 2009, 10:05:09 pm
No, sorry.
Title: rotating and THEN scaling sprite
Post by: Nexus on August 13, 2009, 03:50:11 pm
If you want to apply this behaviour globally, you could setup your sf::View in order to scale the whole scene. That makes sense for me in case of an isometric tilemap.
Title: Re: rotating and THEN scaling sprite
Post by: Imbue on August 13, 2009, 04:32:24 pm
Quote from: "thoniel"
but if i do that directly by sprite.rotate and sprite.scale, it seems that it order is always scale and then rotate.
How can you tell what "order" it was done in, and why does it matter?

The only thing I can think of is the center point of the operations, which should be trivial to change or account for.
Title: rotating and THEN scaling sprite
Post by: Nexus on August 13, 2009, 08:31:19 pm
Imbue, I guess you misunderstood him. When you turn a rectangular sprite, you can't scale its new x and y size (whose axes are parallel to the window).

Anyway, the center doesn't help achieving this issue.
Title: rotating and THEN scaling sprite
Post by: Imbue on August 13, 2009, 11:41:48 pm
Quote from: "Nexus"
When you turn a rectangular sprite, you can't scale its new x and y size (whose axes are parallel to the window).
Ok, that makes sense. Thanks for explaining.