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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - tuttoscorre

Pages: [1]
1
Graphics / Change texture image for a sprite during runtime
« on: May 05, 2013, 12:08:27 am »
Hi! I'm doing a enhanched version of Pong, and I want to make the ball became a fireball when I press "W" key. Everything is working good, in the costructor of my ball class I load the texture like this:
void Load(std::string filename) {
              if(_image.loadFromFile(filename) == false)
        {
                _filename = "";
                _isLoaded = false;
        }
        else
        {
                _filename = filename;
                _sprite.setTexture(_image);
                _isLoaded = true;
        }
}
 

Ok. Now I have to say that my first loading (default) .png texture is 20x20; while the second (fireball one) is 40x40.

When I change the sprite like this (on "W" press event):
Load("fireball.png");
 
yes, it changes, but the drawing area is the one of 20x20 default sprite, so I see only a piece of my fireball sprite! How can I solve this?

ps. If I load first the biggest texture it draws it well!

Thanks a lot.

2
General / Build SFML 1.6 for VS11
« on: April 26, 2013, 04:10:11 pm »
Hi!
As I say in the title, I want to build SFML 1.6 for VS11, but I can't find the source code with cmakelist.txt! Where is it? I only found that in sdk package there is a "src" folder, but didn't find cmakelist!

Thanks.

Pages: [1]
anything