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

Author Topic: [SFML 2] Sprite Size  (Read 19611 times)

0 Members and 1 Guest are viewing this topic.

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
[SFML 2] Sprite Size
« on: January 12, 2012, 10:46:47 pm »
I've updated to the latest sfml 2 snapshot, and i wonder..

.. How do i resize my sprite? No SetSize anymore.. how?

Thanks :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[SFML 2] Sprite Size
« Reply #1 on: January 12, 2012, 11:04:56 pm »
Use the scale (SetScale).
Laurent Gomila - SFML developer

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
[SFML 2] Sprite Size
« Reply #2 on: January 12, 2012, 11:06:24 pm »
But that gets a factor and not a concrete dimension, shouldnt there be another way?

But i guess i can just make the same thing like this :)

Haikarainen

  • Guest
[SFML 2] Sprite Size
« Reply #3 on: January 13, 2012, 06:30:47 am »
Quote from: "DevilWithin"
But that gets a factor and not a concrete dimension, shouldnt there be another way?

But i guess i can just make the same thing like this :)


Since you now can apply textures to shapes, try playing around with a sf::RectangleShape instead.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
[SFML 2] Sprite Size
« Reply #4 on: January 13, 2012, 08:13:15 am »
Quote
But that gets a factor and not a concrete dimension, shouldnt there be another way?

Come on, it's just an extra division: SetScale(newSize / oldSize) instead of Resize(newSize) ;)

Quote
Since you now can apply textures to shapes, try playing around with a sf::RectangleShape instead.

It works too, yes.
Laurent Gomila - SFML developer

 

anything