Originally Posted by
kmdv
I would definitely not recommend using a bare int for something like color. It would be better to wrap that int with a Color class. That way there is no need to care about the underlying format (whether its RGB, ARGB, whatever).
What if I change it like this? Im not 100% sure how I should initilize it in the constructor. And im not sure what to do with my "DrawString" class.
Code:
class Label
{
private:
std::string text;
public:
Label();
Label(string text,int x, int y);
struct rgb
{
int r;
int g;
int b;
};
rgb textColor;
void DrawString(string text, int x, int y);
void SetText(string Ntext) { Ntext = text; }
void SetColor(int R,int G, int B) { textColor.r = R; textColor.g = G; textColor.b = B; }
rgb GetColor() { return textColor; };
string GetText() { return text; }
~Label();
};
Code:
Label::Label()
{
}
Label::Label(string text,int x, int y)
{
}
void Label::DrawString(string text, int x, int y)
{
}
string Label::GetText() {return text;}
void Label::SetText(string Ntext) { Ntext = text; }
Label::rgb Label::GetColor() { return textColor; }
void Label::SetColor(int R, int G, int B) { textColor.r = R; textColor.g = G; textColor.b = B; }