Cinder  0.9.1
Public Member Functions | List of all members
cinder::TextLayout Class Reference

#include <Text.h>

Public Member Functions

 TextLayout ()
 
void clear (const Color &color)
 
void clear (const ColorA &color)
 
void addLine (const std::string &line)
 
void addCenteredLine (const std::string &line)
 
void addRightLine (const std::string &line)
 
void append (const std::string &str)
 
void setFont (const Font &font)
 
void setColor (const Color &color)
 
void setColor (const ColorA &color)
 
void setLeadingOffset (float leadingOffset)
 
void setBorder (int horizontal, int vertical)
 
Surface render (bool useAlpha=false, bool premultiplied=false)
 

Constructor & Destructor Documentation

cinder::TextLayout::TextLayout ( )

This is an abstract line.

Makes a TextLayout Object.

Member Function Documentation

void cinder::TextLayout::clear ( const Color color)

Sets the background color for the TextLayout. Implicit opqaue alpha.

void cinder::TextLayout::clear ( const ColorA color)

Sets the background color and alpha for the TextLayout to unpremulitiplied color color.

void cinder::TextLayout::addLine ( const std::string &  line)

Adds a left-justified line of text to the layout. Assumes UTF-8 encoding.

void cinder::TextLayout::addCenteredLine ( const std::string &  line)

Adds a centered line of text to the layout. Assumes UTF-8 encoding.

void cinder::TextLayout::addRightLine ( const std::string &  line)

Adds a right-justified line of text to the layout. Assumes UTF-8 encoding.

void cinder::TextLayout::append ( const std::string &  str)

Appends string str to the current line. Assumes UTF-8 encoding.

void cinder::TextLayout::setFont ( const Font font)
void cinder::TextLayout::setColor ( const Color color)

Sets the currently active color. Implicit opqaue alpha.

void cinder::TextLayout::setColor ( const ColorA color)

Sets the currently active color and alpha.

void cinder::TextLayout::setLeadingOffset ( float  leadingOffset)

Sets an offset relative to the default leading (the vertical space between lines).

void cinder::TextLayout::setBorder ( int  horizontal,
int  vertical 
)

Adds a horizontal pixel border to the left and the right sides, and a vertical border to the top and bottom.

Surface cinder::TextLayout::render ( bool  useAlpha = false,
bool  premultiplied = false 
)

Returns a Surface into which the TextLayout is rendered. If useAlpha the Surface will contain an alpha channel. If premultiplied the alpha will be premulitplied.


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