Hello.
I use 4 classes in my project atm:
-ScreenMenager: use to menage screens;
-VirtualClass: using virtual methods;
-GameScreen: main screen which I want to use for interactions between other classes;
-PlayerClass;
ScreenMenager has a pointer to VirtualClass. I use it to display GameScreens methods by virtual ones. PlayerClass has private Sprite and Texture which I want to display. Its going like:
GameScreen class has no Texture and no Sprite.
void GameScreen::Draw(sf::RenderWindow &window)
{
players.Draw(window); // <-- PlayerClass object;
}
void PlayerClass::Draw(sf::RenderWindow &window)
{
window.draw(playerSprite);
}
I loaded texture in PlayerClass by using constructor.
My question is how can I transfer the texture to PlayerClass or how can I display it from PlayerClass level? Is it even possible or I have to find other way?