Hi again,
Sorry for another topic so soon. While trying to test some behavior with sprites, I ended up running into a problem where I couldn't transform the sprite unless I overrode the respective transform methods in my Entity class (which inherits Drawable and Transformable), such as
setPosition(float x, float y) or
move(float x, float y).
Essentially, this is the layout of what I have that works - and if I want to manipulate the position of the Entity, I just call the respective function (if you'd like me to post the actual code I have, please just let me know):
class Entity : public Drawable, public Transformable {
private:
sf::Sprite sprite;
sf::Texture texture;
sf::VertexArray vertices;
public:
void setPosition(float x, float y) { sprite.setPosition(x, y); }
// Other miscellaneous functions.
};
Previously, if I declared an Entity and just called something like
Entity.setPosition() or
Entity.getSprite().setPosition() (i.e. without overriding any transform methods), the transform wouldn't apply. I was looking through the documentation/tutorials for Transformable, Sprite, and Texture, and didn't see any reason as to why I'm getting this behavior unless I misunderstood the tutorials and sample code.
I greatly appreciate any assistance/advice on the matter.