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

Author Topic: sf::Sprite.getGlobalBounds().width or height  (Read 3683 times)

0 Members and 1 Guest are viewing this topic.

Jalfor

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
sf::Sprite.getGlobalBounds().width or height
« on: October 10, 2012, 01:11:48 pm »
I've worked out that sf::Sprite.getGlobalBounds().left and top get the left most and the top most parts of the sprite after transformations, though what does width and height do? Does it get the distance from the left most corner to the right most corner / the top most corner to the bottom most corner or something else? Thanks.
If a picture tells 1000 words, then a YouTube video clearly tells 1000000 making a YouTube video obviously a larger work than the Lord Of The Rings, or some other massive novel. Thus are the laws of YouTube videos.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: sf::Sprite.getGlobalBounds().width or height
« Reply #1 on: October 10, 2012, 01:43:37 pm »
The global bounds is an axis-aligned (not rotated) rectangle, so it may be bigger than the sprite itself if it is rotated. Something like this:

(sorry I just put the first image found on Google)
Laurent Gomila - SFML developer

Jalfor

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: sf::Sprite.getGlobalBounds().width or height
« Reply #2 on: October 11, 2012, 02:26:25 am »
Thanks
If a picture tells 1000 words, then a YouTube video clearly tells 1000000 making a YouTube video obviously a larger work than the Lord Of The Rings, or some other massive novel. Thus are the laws of YouTube videos.

 

anything