Crazy Eddies GUI System
0.7.2
|
Class representing a rendered string of entities. More...
Public Member Functions | |
RenderedString () | |
Constructor. | |
virtual | ~RenderedString () |
Destructor. | |
void | draw (const size_t line, GeometryBuffer &buffer, const Vector2 &position, const ColourRect *mod_colours, const Rect *clip_rect, const float space_extra) const |
Draw the string to a GeometryBuffer. More... | |
Size | getPixelSize (const size_t line) const |
return the pixel size of the specified line. More... | |
void | appendComponent (const RenderedStringComponent &component) |
append component to the list of components drawn for this string. | |
void | clearComponents () |
clear the list of components drawn for this string. | |
size_t | getComponentCount () const |
return the number of components that make up this string. | |
void | split (const size_t line, float split_point, RenderedString &left) |
split the string in line line as close to split_point as possible. More... | |
size_t | getSpaceCount (const size_t line) const |
return the total number of spacing characters in the specified line. | |
void | appendLineBreak () |
linebreak the rendered string at the present position. | |
size_t | getLineCount () const |
return number of lines in this string. | |
RenderedString (const RenderedString &other) | |
Copy constructor. | |
RenderedString & | operator= (const RenderedString &rhs) |
Assignment. | |
Protected Types | |
typedef std::vector < RenderedStringComponent * > | ComponentList |
Collection type used to hold the string components. | |
typedef std::pair< size_t, size_t > | LineInfo |
track info for a line. first is componetn idx, second is component count. | |
typedef std::vector< LineInfo > | LineList |
Collection type used to hold details about the lines. | |
Protected Member Functions | |
void | cloneComponentList (const ComponentList &list) |
Make this object's component list a clone of list. | |
Static Protected Member Functions | |
static void | clearComponentList (ComponentList &list) |
Free components in the given ComponentList and clear the list. | |
Protected Attributes | |
ComponentList | d_components |
RenderedStringComponent objects that comprise this RenderedString. | |
LineList | d_lines |
lines that make up this string. | |
Class representing a rendered string of entities.
Here 'string' does not refer solely to a text string, rather a string of any renderable items.
void CEGUI::RenderedString::draw | ( | const size_t | line, |
GeometryBuffer & | buffer, | ||
const Vector2 & | position, | ||
const ColourRect * | mod_colours, | ||
const Rect * | clip_rect, | ||
const float | space_extra | ||
) | const |
Draw the string to a GeometryBuffer.
line | The line of the RenderedString to draw. |
buffer | GeometryBuffer object that is to receive the geometry resulting from the draw operations. |
position | Vector2 describing the position where the RenderedString is to be drawn. Note that this is not the final onscreen position, but the position as offset from the top-left corner of the entity represented by the GeometryBuffer. |
mod_colours | Pointer to a ColourRect describing colour values that are to be modulated with the any stored colour values to calculate the final colour values to be used. This may be 0 if no modulated colours are required. NB: Each specific component will decide if and how it will apply the modulated colours. |
clip_rect | Pointer to a Rect object that describes a clipping rectangle that should be used when drawing the RenderedString. This may be 0 if no clipping is required. |
space_extra | float value indicating additional padding value to be applied to space characters in the string. |
InvalidRequestException | thrown if line is out of range. |
Size CEGUI::RenderedString::getPixelSize | ( | const size_t | line | ) | const |
return the pixel size of the specified line.
Return the pixel size of a specified line for the RenderedString.
line | The line number whose size is to be returned. |
InvalidRequestException | thrown if line is out of range. |
void CEGUI::RenderedString::split | ( | const size_t | line, |
float | split_point, | ||
RenderedString & | left | ||
) |
split the string in line line as close to split_point as possible.
The RenderedString \a left will receive the left portion of the split, while the right portion of the split will remain in this RenderedString.
line | The line number on which the split is to occur. |
split_point | float value specifying the pixel location where the split should occur. The actual split will occur as close to this point as possible, though preferring a shorter 'left' portion when the split can not be made exactly at the requested point. |
left | RenderedString object that will receieve the left portion of the split. Any existing content in the RenderedString is replaced. |
InvalidRequestException | thrown if line is out of range. |