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

Author Topic: Problem with drawing text from inherited class  (Read 1298 times)

0 Members and 1 Guest are viewing this topic.

Szustarol

  • Newbie
  • *
  • Posts: 19
    • View Profile
Problem with drawing text from inherited class
« 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

dmitry_t

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Problem with drawing text from inherited class
« Reply #1 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.

 

anything