Browse Source

Implement Text::SetInt().

legacy
Sam Hocevar sam 14 years ago
parent
commit
8df4d092a5
2 changed files with 10 additions and 0 deletions
  1. +9
    -0
      src/text.cpp
  2. +1
    -0
      src/text.h

+ 9
- 0
src/text.cpp View File

@@ -53,6 +53,15 @@ void Text::SetText(char const *text)
data->text = text ? strdup(text) : NULL;
}

void Text::SetInt(int val)
{
if (data->text)
free(data->text);
char buf[128];
sprintf(buf, "%i", val);
data->text = strdup(buf);
}

void Text::SetPos(int3 pos)
{
data->pos = pos;


+ 1
- 0
src/text.h View File

@@ -27,6 +27,7 @@ public:
virtual ~Text();

void SetText(char const *text);
void SetInt(int val);
void SetPos(int3 pos);

protected:


Loading…
Cancel
Save