Public Member Functions | Public Attributes | List of all members
pText Class Reference

Helper class. Cut text to widget size. More...

#include <primitiveGui.h>

Inheritance diagram for pText:

Public Member Functions

 pText (float marginLeft, float marginRight, bool textCentered, int cutDirection)
 
void setParentGeom (sf::Vector2f position, sf::Vector2f size)
 
void addSymbol (sf::String &symbol)
 
void setNewSymbol (sf::String &symbol)
 
void removeLastSymbol ()
 
void updateText ()
 

Public Attributes

sf::String fullString
 Full string of text object.
 
sf::String visibleString
 Visible string of text object.
 

Detailed Description

Helper class. Cut text to widget size.

This class inherits of sf::Text class from SFML. It's used by widgets which have string to display.

Constructor & Destructor Documentation

pText::pText ( float  marginLeft,
float  marginRight,
bool  textCentered,
int  cutDirection 
)

Default constructor.

Parameters
marginLeft
marginRight
textCentered
cutDirection: if 0 cut from begin of string or if 1 cut from end of string

Member Function Documentation

void pText::addSymbol ( sf::String &  symbol)

Add new string to existing string.

Parameters
symbol
void pText::removeLastSymbol ( )

Remove last symbol from string

void pText::setNewSymbol ( sf::String &  symbol)

Set new string instead of existing string.

Parameters
symbol
void pText::setParentGeom ( sf::Vector2f  position,
sf::Vector2f  size 
)

Set parent widget geometry to fill text in this rectangle.

Parameters
position
size
void pText::updateText ( )

Update text ( cut to parent widget size and set parent position ).


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