Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: rotating and THEN scaling sprite  (Read 4032 times)

0 Members and 1 Guest are viewing this topic.

thoniel

  • Newbie
  • *
  • Posts: 21
    • ICQ Messenger - 157157736
    • View Profile
rotating and THEN scaling sprite
« 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
rotating and THEN scaling sprite
« Reply #1 on: August 01, 2009, 10:05:09 pm »
No, sorry.
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
rotating and THEN scaling sprite
« Reply #2 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Imbue

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: rotating and THEN scaling sprite
« Reply #3 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.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
rotating and THEN scaling sprite
« Reply #4 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Imbue

  • Full Member
  • ***
  • Posts: 104
    • View Profile
rotating and THEN scaling sprite
« Reply #5 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.

 

anything