Support Forum       G3D Web Page     
Classes | Public Member Functions | List of all members
G3D::GuiText Class Reference

Text or Icon on a G3D::GuiControl. More...

Classes

struct  Element
 
class  Symbol
 Loads standard symbols from the greek.fnt and icon.fnt fonts. More...
 

Public Member Functions

 GuiText (const String &text="", const shared_ptr< GFont > &font=shared_ptr< GFont >(), float size=-1.0f, const Color4 &color=Color4(-1, -1, -1, -1), const Color4 &outlineColor=Color4(-1, -1, -1, -1), const Vector2 &offset=Vector2::zero())
 Negative alpha values on color, outlineColor, and size mean "use default". nullptr font means "use default". More...
 
 GuiText (const char *text)
 
 GuiText (const shared_ptr< Texture > &texture, const Rect2D &srcRect)
 Create an icon. More...
 
 GuiText (const Icon &icon)
 
void append (const String &text, const shared_ptr< GFont > &font=shared_ptr< GFont >(), float size=-1.0f, const Color4 &color=Color4(-1, -1, -1, -1), const Color4 &outlineColor=Color4(-1, -1, -1, -1), const Vector2 &offset=Vector2::zero())
 Adds this text to the end of the GuiText. More...
 
const Elementelement (int e) const
 Returns element e within this GuiText. More...
 
bool empty () const
 True if this is an empty caption. More...
 
const Rect2DiconSourceRect () const
 
const shared_ptr< Texture > & iconTexture () const
 
bool isIcon () const
 True if this is an icon. More...
 
int numElements () const
 Returns the number of elements within this GuiText. More...
 
 operator String () const
 Concatenates all of the text within the elements.
More...
 
void setDefault (const shared_ptr< GFont > &dfont, float dsize, const Color4 &dcolor, const Color4 &doutline)
 Provides the value of default values for current elements. More...
 
String text () const
 Concatenates all of the text within the elements. More...
 

Detailed Description

Text or Icon on a G3D::GuiControl.

These are normally created implicitly by a cast from String or by G3D::IconSet, but can be created explicitly when more information needs to be specified.

See also
G3D::GuiLabel, G3D::GuiTextBox, G3D::IconSet, G3D::Icon, G3D::Texture

Constructor & Destructor Documentation

◆ GuiText() [1/4]

G3D::GuiText::GuiText ( const String text = "",
const shared_ptr< GFont > &  font = shared_ptr< GFont >(),
float  size = -1.0f,
const Color4 color = Color4(-1, -1, -1, -1),
const Color4 outlineColor = Color4(-1, -1, -1, -1),
const Vector2 offset = Vector2::zero() 
)

Negative alpha values on color, outlineColor, and size mean "use default". nullptr font means "use default".

Defaults are set on the GuiTheme.

◆ GuiText() [2/4]

G3D::GuiText::GuiText ( const char *  text)

◆ GuiText() [3/4]

G3D::GuiText::GuiText ( const shared_ptr< Texture > &  texture,
const Rect2D srcRect 
)

Create an icon.

Parameters
textureThe source texture.
srcRectThe source rectangle, in pixels of texture
See also
G3D::IconSet.

◆ GuiText() [4/4]

G3D::GuiText::GuiText ( const Icon icon)

Member Function Documentation

◆ append()

void G3D::GuiText::append ( const String text,
const shared_ptr< GFont > &  font = shared_ptr< GFont >(),
float  size = -1.0f,
const Color4 color = Color4(-1, -1, -1, -1),
const Color4 outlineColor = Color4(-1, -1, -1, -1),
const Vector2 offset = Vector2::zero() 
)

Adds this text to the end of the GuiText.

It is an error to append to an icon.

◆ element()

const Element& G3D::GuiText::element ( int  e) const
inline

Returns element e within this GuiText.

◆ empty()

bool G3D::GuiText::empty ( ) const
inline

True if this is an empty caption.

Referenced by G3D::GuiPane::addEnumClassRadioButtons().

◆ iconSourceRect()

const Rect2D& G3D::GuiText::iconSourceRect ( ) const
inline

◆ iconTexture()

const shared_ptr<Texture>& G3D::GuiText::iconTexture ( ) const
inline

◆ isIcon()

bool G3D::GuiText::isIcon ( ) const
inline

True if this is an icon.

Referenced by empty().

◆ numElements()

int G3D::GuiText::numElements ( ) const
inline

Returns the number of elements within this GuiText.

◆ operator String()

G3D::GuiText::operator String ( ) const
inline

Concatenates all of the text within the elements.

◆ setDefault()

void G3D::GuiText::setDefault ( const shared_ptr< GFont > &  dfont,
float  dsize,
const Color4 dcolor,
const Color4 doutline 
)

Provides the value of default values for current elements.

◆ text()

String G3D::GuiText::text ( ) const

Concatenates all of the text within the elements.

Referenced by operator String().


documentation generated on Wed Nov 24 2021 08:01:56 using doxygen 1.8.15