TouchCPLib  1.0.0
A touch-enabled GUI interface based on SDL and libTS. It provides a simple desktop-free UI for your embedded Raspberry projects.
Text Class Reference

A simple text object. More...

#include <Text.h>

Inheritance diagram for Text:
Collaboration diagram for Text:

Public Member Functions

 Text ()
 
 ~Text ()
 
void setText (const char *text)
 Set the text message. More...
 
void setGeometry (Rect geom)
 Set the text geometry (position and size). If width and height are set to -1 the text natural size will be used. More...
 
void setColor (Color c)
 Set the text color. More...
 
void setFontPath (const std::string &fontPath)
 Set the text font. More...
 
void setFontSize (int fontSize)
 Set the font size. More...
 
void draw (uint32_t time) override
 The draw method. It will be called once per frame for each object in a scene. More...
 
int getX () const override
 
int getY () const override
 
int getWidth () const override
 
int getHeight () const override
 
- Public Member Functions inherited from InteractiveGraphicsObject
virtual ~InteractiveGraphicsObject ()=default
 
- Public Member Functions inherited from GraphicsObject
virtual ~GraphicsObject ()=default
 
bool isVisible () const
 
void setVisibility (bool visible)
 
- Public Member Functions inherited from TouchEnabledObject
TouchCallback getTouchCallback () const
 
void setTouchCallback (TouchCallback cb)
 Set the touch interaction callback. More...
 
bool isTouchEnabled () const
 True if the object reacts to touch events. More...
 
void setTouchEnabled (bool enabled)
 Set if the object has to react to touch events. More...
 
bool isPropagateInteraction () const
 True if the object will call the handlers of object placed below when touched. More...
 
void setPropagateInteraction (bool propagate)
 Set wheter the object has to call the handlers of objects placed below, when touched. More...
 

Detailed Description

A simple text object.

Constructor & Destructor Documentation

◆ Text()

Text::Text ( )

◆ ~Text()

Text::~Text ( )

Member Function Documentation

◆ draw()

void Text::draw ( uint32_t  time)
overridevirtual

The draw method. It will be called once per frame for each object in a scene.

Parameters
timeA time parameter (as given by SDL_GetTicks) for time-based animation purposes

Implements GraphicsObject.

◆ getHeight()

int Text::getHeight ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ getWidth()

int Text::getWidth ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ getX()

int Text::getX ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ getY()

int Text::getY ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ setColor()

void Text::setColor ( Color  c)

Set the text color.

Parameters
cThe text color

◆ setFontPath()

void Text::setFontPath ( const std::string &  fontPath)

Set the text font.

Parameters
fontPathThe path to the font

◆ setFontSize()

void Text::setFontSize ( int  fontSize)

Set the font size.

Parameters
fontSizeThe font size

◆ setGeometry()

void Text::setGeometry ( Rect  geom)

Set the text geometry (position and size). If width and height are set to -1 the text natural size will be used.

Parameters
geomThe text geometry

◆ setText()

void Text::setText ( const char *  text)

Set the text message.

Parameters
textThe text to display

The documentation for this class was generated from the following files: