Hi, I've been having troubles drawing my sprite, in my Player class where I'm loading the images, I get no errors when loading the images for the texture, but when I goto run the application, the sprite isn't showing, I have other objects being drawn as well, I have the player being drawn last after everything else, but still down do anything?
Any Ideas?
Drawing the Characters Sprite (This is being called after a statement returns true)
void Lester::PlayerSetup()
{
Player player = *new Player();
sf::Sprite p_sprite(player.p_sprite);
p_sprite.setPosition(200, 200);
p_sprite.setTexture(player.tp_sprite);
window->draw(p_sprite);
}
Player Declarations for sprite image loading
void Player::texture()
{
//tp_down_sprite->loadFromFile("data/assets/player/down_char.png");
//tp_left_sprite->loadFromFile("data/assets/player/left_char.png");
//tp_right_sprite->loadFromFile("data/assets/player/right_char.png");
//tp_up_sprite->loadFromFile("data/assets/player/up_char.png");
if (!tp_sprite.loadFromFile("data/assets/player/up_char.png")){ std::cout << "Unable to load Player Sprites! Please report this Error!"; }
else{ std::cout << "Player Sprite was Loaded Correctly"; }
p_sprite.setTexture(tp_sprite);
}
Cheers.