SFML community forums

Help => General => Topic started by: Szustarol on February 16, 2018, 02:28:41 pm

Title: Problem with drawing text from inherited class
Post by: Szustarol on February 16, 2018, 02:28:41 pm
Hello
this is my modified RectangleShape class:
(click to show/hide)
I have also modified RenderWindow class to draw it:
(click to show/hide)

Sadly, when I try to draw my ClickableButton, the Rectangleshape draws fine, but the text is not displayed. What could be the cause?
Font loads nice because other text displays just fine
Title: Re: Problem with drawing text from inherited class
Post by: dmitry_t on February 16, 2018, 09:14:54 pm
From the code you have posted it is only clear that you do not call cap.setString(caption) inside your button constructor.
If you do that somewhere else, please also post the code which initializes the button.

NB. I would also recommend you to read about C++ virtual functions and function overloading.