SFML community forums

Help => Graphics => Topic started by: Xenavar on February 18, 2010, 03:47:39 am

Title: Sprite + class
Post by: Xenavar on February 18, 2010, 03:47:39 am
Hello,

I can't make a function "GetSprite" inside of my class somehow...

Caracter.H

private:  int Max_Hp;
              int Current_Hp;
              int Max_Mana;
              int Current_Mana;
              sf::Sprite Sprite;
public:
            sf::Sprite GetSprite();

Caracter.cpp

sf::Sprite GetSprite();
{
   return Sprite;
}

there is an error on the "return Sprite" line with the following:
|134|error: `Sprite' was not declared in this scope|

It says it doesn't recognize it, but if I use ''Sprite.something" on any other function inside the class it works.

I am guessing syntax must be incorrect near the bold text. Any help?
Title: Sprite + class
Post by: OniLinkPlus on February 18, 2010, 04:12:15 am
You aren't using the class' name in the function description. And that extra semicolon should prevent it from compiling, too...(just before the curly bracket in the cpp file)
Title: Sprite + class
Post by: Xenavar on February 18, 2010, 04:23:13 am
Its fixed now. Thanks!