Class TextNode

Inheritance Relationships

Base Types

Class Documentation

class TextNode : public simple2dengine::CanvasNode, public Text

Text node. Used to draw text strings.

Public Functions

void setFont(const AssetManager &assetManager, const std::string &filename)

Set or load font.

See
AssetManager.
Parameters
  • assetManager: Asset Manager where asset should be stored.
  • filename: Name of file with relative or full path.

void setString(const std::string &textString)

Set text string.

Parameters
  • textString: - text to display.

void setCharacterSize(unsigned int size)

Set size.

Parameters
  • size: of text.

virtual void updateTransform()

Update transform of the text to correctly display it.

Protected Functions

virtual void render()

Override base render(). We need to draw an image.

See
Node.