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

Author Topic: New sprite dimesions after rotation?  (Read 3885 times)

0 Members and 1 Guest are viewing this topic.

Dummie

  • Newbie
  • *
  • Posts: 25
    • View Profile
New sprite dimesions after rotation?
« on: April 27, 2008, 08:11:41 pm »
Hi,

when I try to rotate a sprite the width and height vlues aren't changed. The functions GetHeight and GetWidth are returning the old values. Why? :)

In my opinion it would be very useful if this would be also done by SFML.
What do you think about it? :)

Thanks in advance,
Dummie

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
New sprite dimesions after rotation?
« Reply #1 on: April 28, 2008, 03:12:08 am »
Width and height don't change after a rotation. They are the local dimensions of the sprite, not the axis-aligned ones.
Laurent Gomila - SFML developer

tgm

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
New sprite dimesions after rotation?
« Reply #2 on: April 28, 2008, 09:17:25 am »
I guess you can get the screenrect... that should be, what you want to get, right??

*edit* dammit ther is no such thing as getScreenRect... (dealing way to much with the String class in the last time ;) )

Dummie

  • Newbie
  • *
  • Posts: 25
    • View Profile
New sprite dimesions after rotation?
« Reply #3 on: April 29, 2008, 05:39:19 pm »
Quote from: "Laurent"
Width and height don't change after a rotation. They are the local dimensions of the sprite, not the axis-aligned ones.


Is there a way to get the axis-aligned ones? I would need them :)

tgm

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
New sprite dimesions after rotation?
« Reply #4 on: April 29, 2008, 06:22:44 pm »
you could simply use sin & cos... I guess...