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

Author Topic: setImage not a member of sf::Sprite  (Read 3944 times)

0 Members and 1 Guest are viewing this topic.

TheDianamu

  • Newbie
  • *
  • Posts: 20
    • View Profile
setImage not a member of sf::Sprite
« on: September 29, 2013, 04:10:54 am »
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


Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: setImage not a member of sf::Sprite
« Reply #2 on: September 29, 2013, 09:09:28 am »
Read an up-to-date documentation ;)
Laurent Gomila - SFML developer

 

anything