Hello,
Is it possible to inherit from sf::String? I am currently trying to write a Score class to make my life easier, but it doesn't quite work.
Here is how I inherit from sf::String, the constructor of sf::String gets called in my constructor, btw.
#ifndef SCORE_H_INCLUDED
#define SCORE_H_INCLUDED
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
namespace readOnly {
class Score : public sf::String {
public:
Score(float PosX = 0, float PosY = 0);
~Score();
void SetScore(int score);
void Add(int addScore = 1);
const int& GetScore() const;
void Update();
private:
int m_score;
};
}
#endif // SCORE_H_INCLUDED