Browse Source

core: Text constructor now wants a String object.

undefined
Sam Hocevar 11 years ago
parent
commit
5ff15c08d4
2 changed files with 5 additions and 6 deletions
  1. +3
    -4
      src/text.cpp
  2. +2
    -2
      src/text.h

+ 3
- 4
src/text.cpp View File

@@ -41,18 +41,17 @@ private:
* Public Text class * Public Text class
*/ */


Text::Text(char const *text, char const *font)
Text::Text(String const &text, char const *font)
: data(new TextData()) : data(new TextData())
{ {
data->font = Forge::Register(font); data->font = Forge::Register(font);
if (text)
data->m_text = text;
data->m_text = text;
data->pos = vec3(0, 0, 0); data->pos = vec3(0, 0, 0);


m_drawgroup = DRAWGROUP_HUD; m_drawgroup = DRAWGROUP_HUD;
} }


void Text::SetText(char const *text)
void Text::SetText(String const &text)
{ {
data->m_text = text; data->m_text = text;
} }


+ 2
- 2
src/text.h View File

@@ -26,10 +26,10 @@ class TextData;
class Text : public Entity class Text : public Entity
{ {
public: public:
Text(char const *text, char const *font);
Text(String const &text, char const *font);
virtual ~Text(); virtual ~Text();


void SetText(char const *text);
void SetText(String const &text);
void SetInt(int val); void SetInt(int val);
void SetPos(vec3 pos); void SetPos(vec3 pos);
vec3 GetPos(); vec3 GetPos();


Loading…
Cancel
Save