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

Author Topic: How to resize a sprite... what am i missing?  (Read 6634 times)

0 Members and 1 Guest are viewing this topic.

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
How to resize a sprite... what am i missing?
« on: June 28, 2013, 09:23:58 am »
Hi folks,

I've tried reading several examples and I can't figure out what I'm doing wrong for some sprites I want to resize.



if (!tChar1.loadFromFile("graphics/guitar_accustic.png"))
        std::cout << "Unable to load guitar_accustic.png \n";
        sChar1.setTexture(tChar1);
        sChar1.setTextureRect(sf::IntRect(0,0,64,64));
        sChar1.setPosition(100,100);
        sChar1.Resize(128,128);

tchar1 = the texture i used
schar1 = the sprite i created

The error i'm getting is 'class of sf::sprite' has no member named Resize.

Am I using it wrong?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to resize a sprite... what am i missing?
« Reply #1 on: June 28, 2013, 09:26:32 am »
Resize doesn't exist in SFML 2.0 Please read the API documentation ;)

Use sprite.setScale(2, 2) instead.
Laurent Gomila - SFML developer

 

anything