ofxOui - UI Components for OpenFrameworks

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ofxOui::TextBox Class Reference

Text box font wrapper. More...

#include <ofxOuiTextBox.hpp>

Public Member Functions

 TextBox ()
 Default Constructor. More...
 
virtual ~TextBox ()
 Destructor. More...
 
virtual void update ()
 OF-like update function: updates the position of the icon. More...
 
virtual void draw ()
 OF-like draw function: draws the text box. More...
 
virtual string getFontPath () const
 get the path to the font path More...
 
virtual void setFontPath (string path)
 set the path to the font path More...
 
virtual float getFontSize () const
 get the font size More...
 
virtual void setFontSize (float size)
 set the font size More...
 
virtual float getLetterSpacing () const
 get the letter spacing More...
 
virtual void setLetterSpacing (float letter_spacing)
 set the letter spacing More...
 
virtual float getLineHeight () const
 get the line height More...
 
virtual void setLineHeight (float line_height)
 set the line height More...
 
virtual int getCharacterIndex (int x_, int y_) const
 get the index of the character at a given mouse position More...
 
virtual int getCursorIndex (int x_, int y_) const
 get the index of the cursor (inter-character) at a given mouse position More...
 

Public Attributes

string text = ""
 label More...
 
int x = 0
 x position (of the containing box) More...
 
int y = 0
 y position (of the containing box) More...
 
int width = 100
 width (of the containing box) More...
 
int height = 100
 height (of the containing box) More...
 
int padding = 10
 padding (within the containing box) More...
 
Anchor alignment = ofxOui::Anchor::MiddleCenter
 Alignment. More...
 
ofColor color = ofColor::black
 Color (in case of a binary icon) More...
 
ofRectangle rect
 Actual rectangle where the text is drawn. More...
 

Protected Member Functions

virtual void adjustFont_ ()
 

Protected Attributes

ofTrueTypeFont * base_Font_
 
string font_path_
 
float font_size_
 
float line_height_
 
float letter_spacing_ = 1.
 
int y_diff_
 

Detailed Description

Text box font wrapper.

Constructor & Destructor Documentation

§ TextBox()

ofxOui::TextBox::TextBox ( )

Default Constructor.

§ ~TextBox()

ofxOui::TextBox::~TextBox ( )
virtual

Destructor.

Member Function Documentation

§ adjustFont_()

void ofxOui::TextBox::adjustFont_ ( )
protectedvirtual

§ draw()

void ofxOui::TextBox::draw ( )
virtual

OF-like draw function: draws the text box.

§ getCharacterIndex()

int ofxOui::TextBox::getCharacterIndex ( int  x_,
int  y_ 
) const
virtual

get the index of the character at a given mouse position

Parameters
x_x mouse position
y_y mouse position
Returns
character index

§ getCursorIndex()

int ofxOui::TextBox::getCursorIndex ( int  x_,
int  y_ 
) const
virtual

get the index of the cursor (inter-character) at a given mouse position

Parameters
x_x mouse position
y_y mouse position
Returns
character index

§ getFontPath()

string ofxOui::TextBox::getFontPath ( ) const
virtual

get the path to the font path

Returns
the path to the font path

§ getFontSize()

float ofxOui::TextBox::getFontSize ( ) const
virtual

get the font size

Returns
the font size

§ getLetterSpacing()

float ofxOui::TextBox::getLetterSpacing ( ) const
virtual

get the letter spacing

Returns
the letter spacing

§ getLineHeight()

float ofxOui::TextBox::getLineHeight ( ) const
virtual

get the line height

Returns
the line height

§ setFontPath()

void ofxOui::TextBox::setFontPath ( string  path)
virtual

set the path to the font path

Parameters
paththe path to the font path

§ setFontSize()

void ofxOui::TextBox::setFontSize ( float  size)
virtual

set the font size

Parameters
sizethe font size

§ setLetterSpacing()

void ofxOui::TextBox::setLetterSpacing ( float  letter_spacing)
virtual

set the letter spacing

Parameters
letter_spacingthe letter spacing

§ setLineHeight()

void ofxOui::TextBox::setLineHeight ( float  line_height)
virtual

set the line height

Parameters
line_heightthe line height

§ update()

void ofxOui::TextBox::update ( )
virtual

OF-like update function: updates the position of the icon.

Member Data Documentation

§ alignment

Anchor ofxOui::TextBox::alignment = ofxOui::Anchor::MiddleCenter

Alignment.

§ base_Font_

ofTrueTypeFont* ofxOui::TextBox::base_Font_
protected

§ color

ofColor ofxOui::TextBox::color = ofColor::black

Color (in case of a binary icon)

§ font_path_

string ofxOui::TextBox::font_path_
protected

§ font_size_

float ofxOui::TextBox::font_size_
protected

§ height

int ofxOui::TextBox::height = 100

height (of the containing box)

§ letter_spacing_

float ofxOui::TextBox::letter_spacing_ = 1.
protected

§ line_height_

float ofxOui::TextBox::line_height_
protected

§ padding

int ofxOui::TextBox::padding = 10

padding (within the containing box)

§ rect

ofRectangle ofxOui::TextBox::rect

Actual rectangle where the text is drawn.

§ text

string ofxOui::TextBox::text = ""

label

§ width

int ofxOui::TextBox::width = 100

width (of the containing box)

§ x

int ofxOui::TextBox::x = 0

x position (of the containing box)

§ y

int ofxOui::TextBox::y = 0

y position (of the containing box)

§ y_diff_

int ofxOui::TextBox::y_diff_
protected

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