Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 std::string &text="", const GFont::Ref &font=GFont::Ref(), 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". NULL font means "use default".
 
 GuiText (const char *text)
 
 GuiText (const shared_ptr< Texture > &texture, const Rect2D &srcRect)
 Create an icon.
 
 GuiText (const Icon &icon)
 
void append (const std::string &text, const GFont::Ref &font=GFont::Ref(), 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.
 
const Elementelement (int e) const
 Returns element e within this GuiText.
 
bool empty () const
 True if this is an empty caption.
 
const Rect2DiconSourceRect () const
 
const shared_ptr< Texture > & iconTexture () const
 
bool isIcon () const
 True if this is an icon.
 
int numElements () const
 Returns the number of elements within this GuiText.
 
 operator std::string () const
 Concatenates all of the text within the elements.
 
void setDefault (const GFont::Ref &dfont, float dsize, const Color4 &dcolor, const Color4 &doutline)
 Provides the value of default values for current elements.
 
std::string text () const
 Concatenates all of the text within the elements.
 

Detailed Description

Text or Icon on a G3D::GuiControl.

These are normally created implicitly by a cast from std::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

G3D::GuiText::GuiText ( const std::string text = "",
const GFont::Ref font = GFont::Ref(),
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". NULL font means "use default".

Defaults are set on the GuiTheme.

G3D::GuiText::GuiText ( const char *  text)
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.
G3D::GuiText::GuiText ( const Icon icon)

Member Function Documentation

void G3D::GuiText::append ( const std::string text,
const GFont::Ref font = GFont::Ref(),
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.

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

Returns element e within this GuiText.

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

True if this is an empty caption.

const Rect2D& G3D::GuiText::iconSourceRect ( ) const
inline
const shared_ptr<Texture>& G3D::GuiText::iconTexture ( ) const
inline
bool G3D::GuiText::isIcon ( ) const
inline

True if this is an icon.

Referenced by empty().

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

Returns the number of elements within this GuiText.

G3D::GuiText::operator std::string ( ) const
inline

Concatenates all of the text within the elements.

void G3D::GuiText::setDefault ( const GFont::Ref dfont,
float  dsize,
const Color4 dcolor,
const Color4 doutline 
)

Provides the value of default values for current elements.

std::string G3D::GuiText::text ( ) const

Concatenates all of the text within the elements.

Referenced by operator std::string().


documentation generated on Sat Jan 12 2013 22:49:55 using doxygen 1.8.2