Here's the class declaration in the .cpp file:
void object::loadImage(string image)
{
obImg->LoadFromFile(image.c_str());////////////////
obSpr->SetImage(obImg);
}
Here is the declaration in a .h file for object class:
class object
{
public:
void move (std::string, float);
void setPosition(float, float);
void loadImage(std::string);
void center (int, int);
//void obArray();
void newInstance();
void instance(int, float, float, float, int, std::string, float);
void deleteInstance(int);
void deleteAllInstances();
object();
~object();
//////VARIABLES
float x;
float y;
float rotation;
bool collision;
float boundBox[2];
bool display;
float origin[2];
float moveSpeed;
private:
std::string moveType;
sf::Image *obImg;
sf::Sprite *obSpr;
instance *instances;
};