TextBox Class Reference

Box of text with line control. More...

#include <textbox.h>

Collaboration diagram for TextBox:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 TextBox ()
 Default constructor.
void Init (Types::Screen::selector screen, int bgid, FT_Face face, int size, int x, int y, int width=0, int height=0)
int size () const
 Get the font size.
int x () const
 Get the X position of the left side.
int y () const
 Get the Y position of the bottom side.
int width () const
 Get the width of the box in pixels.
int height () const
 Get the height of the box in pixels.
bool floats () const
 Get whether the text box floats or not.
bool independent () const
 Get whether the text box is independent or not.
bool visible () const
 Get whether the text will be visible or not.
std::string text () const
 Get the text.
Types::Screen::selector screen () const
 Get the screen where the textbox is.
int bgid () const
 Get the background id.
void SetProperties (int x, int y, int width, int height)
 Set the position and dimensions of a TextBox.
void text (const std::string &str, bool convert_to_romaji=false)
 Set the text.
void floats (bool f)
 Set whether the text box floats or not.
void independent (bool i)
 Set whether the text box is independent or not.
void visible (bool v)
 Set whether the text will be visible or not.
void Move (int x, int y)
 Moves the text box to another position.
void Adjust (int y)
 Adjust the text box vertically if the upper box overlaps.
void Print ()
 Prints the text box in its position.

Private Member Functions

std::string ConvertToRomaji (std::string str)
 Convert kana string to romaji.

Private Attributes

FT_Face face_
 Face of the font, not necesary to have the correct size.
std::string text_
 String of text to print.
int size_
 Font size.
int x_
 X position of the left side.
int y_
 Y position of the bottom side.
int width_
 Width of the box in pixels.
int height_
 Height of the box in pixels.
bool mutable_height_
 Whether the height is mutable or not.
bool floats_
bool independent_
bool visible_
Types::Screen::selector screen_
 Screen where the text box is.
int bgid_


Detailed Description

Box of text with line control.

Definition at line 30 of file textbox.h.


Member Function Documentation

void TextBox::floats ( bool  f  ) 

Set whether the text box floats or not.

See also:
floats_

Definition at line 104 of file textbox.cpp.

bool TextBox::floats (  )  const

Get whether the text box floats or not.

See also:
floats_

Definition at line 84 of file textbox.cpp.

Referenced by SubScreenHandler::SetMode(), and MainScreenHandler::SetMode().

void TextBox::independent ( bool  i  ) 

Set whether the text box is independent or not.

See also:
independent_

Definition at line 109 of file textbox.cpp.

bool TextBox::independent (  )  const

Get whether the text box is independent or not.

See also:
independent_

Definition at line 89 of file textbox.cpp.

void TextBox::Init ( Types::Screen::selector  screen,
int  bgid,
FT_Face  face,
int  size,
int  x,
int  y,
int  width = 0,
int  height = 0 
)

Initializer

Parameters:
screen Screen where the text box is
bgid background id
face FT_Face object from the TextHandler class
size Font size
x X position of the left side
y Y position of the bottom side
width Width of the box in pixels
height Maximum height of the box. By default is 0 which means infinite

Definition at line 32 of file textbox.cpp.

Referenced by TextBoxHandler::NewTextBox().

void TextBox::visible ( bool  v  ) 

Set whether the text will be visible or not.

See also:
visible_

Definition at line 114 of file textbox.cpp.

bool TextBox::visible (  )  const

Get whether the text will be visible or not.

See also:
visible_

Definition at line 94 of file textbox.cpp.

Referenced by MainScreenHandler::PrintCard(), MainScreenHandler::SetMode(), and MainScreenHandler::ViewNext().


Member Data Documentation

int TextBox::bgid_ [private]

Background id

Definition at line 114 of file textbox.h.

Referenced by bgid(), Init(), and Print().

bool TextBox::floats_ [private]

A floating text box isn't adjusted by its predecessor nor adjusts the next text box. By default: false

Definition at line 100 of file textbox.h.

Referenced by floats(), and Init().

bool TextBox::independent_ [private]

An independent text box won't be printed by the text boxes handler needs to be manually printed. By default: false

Definition at line 100 of file textbox.h.

Referenced by independent(), and Init().

bool TextBox::visible_ [private]

Text not visible is rendered by the freetype library (needed to compute the spacing) but it's not printed to the screen. By default: true

Definition at line 100 of file textbox.h.

Referenced by Init(), Print(), and visible().


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

Generated on Fri Oct 2 10:25:29 2009 for DSMemorizer by  doxygen 1.5.8