I'm having troubles with my tile class for my engine. I'm using the SFML 2.1 and coding visual c++ 2010
I get the following on compile:
'setImage' : is not a member of 'sf::Sprite'
Tile.cpp:
#include "Tile.h"
#include <SFML\Graphics.hpp>
Tile::Tile(sf::Image& image)
{
baseSprite.setImage(image, true);
}
Tile::~Tile()
{
}
void Tile::Draw(int x, int y, sf::RenderWindow* rw)
{
baseSprite.setPosition(x, y);
rw->draw(baseSprite);
}
Tile.h:
#ifndef _TILE_H
#define _TILE_H
#include <SFML\Graphics.hpp>
class Tile
{
private:
sf::Sprite baseSprite;
public:
Tile(sf::Image& image);
~Tile();
void Draw(int x, int y, sf::RenderWindow* rw);
};
#endif