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

Author Topic: SFML 2.0 Visual Studio sf::Sprite  (Read 4362 times)

0 Members and 1 Guest are viewing this topic.

Linux Vs God

  • Newbie
  • *
  • Posts: 18
    • View Profile
SFML 2.0 Visual Studio sf::Sprite
« on: August 14, 2011, 09:29:19 am »
I compiled sfml 2.0 with nmake using this tutorial . Everything is fine and dandy until I want to work with sprites. My error "Error: class "sf::Sprite" has no member "SetImage"". On my old computer a few weeks ago I compiled sfml 2.0 the same way i just did and it worked. Now it doesn't. Was there a change in sfml? Please help

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2.0 Visual Studio sf::Sprite
« Reply #1 on: August 14, 2011, 09:39:32 am »
Quote
Now it doesn't. Was there a change in sfml?

Yes. Please read the online documentation, and the relevant topics in the general forum.
http://www.sfml-dev.org/forum/viewtopic.php?t=5343
http://www.sfml-dev.org/forum/viewtopic.php?t=5503
Laurent Gomila - SFML developer

Linux Vs God

  • Newbie
  • *
  • Posts: 18
    • View Profile
SFML 2.0 Visual Studio sf::Sprite
« Reply #2 on: August 14, 2011, 09:58:16 am »
So how would I set a sprites image? I read through the documentation and I still don't understand.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML 2.0 Visual Studio sf::Sprite
« Reply #3 on: August 14, 2011, 10:05:21 am »
Seriously? ...

Quote from: "documentation example"
Code: [Select]
// Declare and load a texture
 sf::Texture texture;
 texture.LoadFromFile("texture.png");
 
 // Create a sprite
 sf::Sprite sprite;
 sprite.SetTexture(texture);
 sprite.SetSubRect(sf::IntRect(10, 10, 50, 30));
 sprite.Resize(100, 60);

 // Display it
 window.Draw(sprite); // window is a sf::RenderWindow
Laurent Gomila - SFML developer

Linux Vs God

  • Newbie
  • *
  • Posts: 18
    • View Profile
SFML 2.0 Visual Studio sf::Sprite
« Reply #4 on: August 14, 2011, 10:06:48 am »
thank you.

 

anything