SFML community forums

Help => Graphics => Topic started by: nicforte on June 28, 2013, 09:23:58 am

Title: How to resize a sprite... what am i missing?
Post by: nicforte 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?
Title: Re: How to resize a sprite... what am i missing?
Post by: Laurent 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.