A drawable object which renders a line of text. More...
Inherits Drawable.
Classes | |
| class | ValueTreeWrapper |
| Internally-used class for wrapping a DrawableText's state into a ValueTree. More... | |
Public Member Functions | |
| DrawableText () | |
| Creates a DrawableText object. | |
| DrawableText (const DrawableText &other) | |
| ~DrawableText () | |
| Destructor. | |
| void | setText (const String &newText) |
| Sets the text to display. | |
| const String & | getText () const noexcept |
| Returns the currently displayed text. | |
| void | setColour (const Colour &newColour) |
| Sets the colour of the text. | |
| const Colour & | getColour () const noexcept |
| Returns the current text colour. | |
| void | setFont (const Font &newFont, bool applySizeAndScale) |
| Sets the font to use. | |
| const Font & | getFont () const noexcept |
| Returns the current font. | |
| void | setJustification (const Justification &newJustification) |
| Changes the justification of the text within the bounding box. | |
| const Justification & | getJustification () const noexcept |
| Returns the current justification. | |
| const RelativeParallelogram & | getBoundingBox () const noexcept |
| Returns the parallelogram that defines the text bounding box. | |
| void | setBoundingBox (const RelativeParallelogram &newBounds) |
| Sets the bounding box that contains the text. | |
| const RelativeCoordinate & | getFontHeight () const |
| void | setFontHeight (const RelativeCoordinate &newHeight) |
| const RelativeCoordinate & | getFontHorizontalScale () const |
| void | setFontHorizontalScale (const RelativeCoordinate &newScale) |
| void | paint (Graphics &g) |
| Drawable * | createCopy () const |
| void | refreshFromValueTree (const ValueTree &tree, ComponentBuilder &builder) |
| ValueTree | createValueTree (ComponentBuilder::ImageProvider *imageProvider) const |
| Rectangle< float > | getDrawableBounds () const |
Static Public Attributes | |
| static const Identifier | valueTreeType |
A drawable object which renders a line of text.
Creates a DrawableText object.
| DrawableText::DrawableText | ( | const DrawableText & | other | ) |
Destructor.
| void DrawableText::setText | ( | const String & | newText | ) |
Sets the text to display.
| const String& DrawableText::getText | ( | ) | const |
Returns the currently displayed text.
| void DrawableText::setColour | ( | const Colour & | newColour | ) |
Sets the colour of the text.
| const Colour& DrawableText::getColour | ( | ) | const |
Returns the current text colour.
| void DrawableText::setFont | ( | const Font & | newFont, |
| bool | applySizeAndScale | ||
| ) |
Sets the font to use.
Note that the font height and horizontal scale are set as RelativeCoordinates using setFontHeight and setFontHorizontalScale. If applySizeAndScale is true, then these height and scale values will be changed to match the dimensions of the font supplied; if it is false, then the new font object's height and scale are ignored.
| const Font& DrawableText::getFont | ( | ) | const |
Returns the current font.
| void DrawableText::setJustification | ( | const Justification & | newJustification | ) |
Changes the justification of the text within the bounding box.
| const Justification& DrawableText::getJustification | ( | ) | const |
Returns the current justification.
| const RelativeParallelogram& DrawableText::getBoundingBox | ( | ) | const |
Returns the parallelogram that defines the text bounding box.
| void DrawableText::setBoundingBox | ( | const RelativeParallelogram & | newBounds | ) |
Sets the bounding box that contains the text.
| const RelativeCoordinate& DrawableText::getFontHeight | ( | ) | const |
| void DrawableText::setFontHeight | ( | const RelativeCoordinate & | newHeight | ) |
| const RelativeCoordinate& DrawableText::getFontHorizontalScale | ( | ) | const |
| void DrawableText::setFontHorizontalScale | ( | const RelativeCoordinate & | newScale | ) |
| void DrawableText::paint | ( | Graphics & | g | ) | [virtual] |
Reimplemented from Component.
| Drawable* DrawableText::createCopy | ( | ) | const [virtual] |
Implements Drawable.
| void DrawableText::refreshFromValueTree | ( | const ValueTree & | tree, |
| ComponentBuilder & | builder | ||
| ) |
| ValueTree DrawableText::createValueTree | ( | ComponentBuilder::ImageProvider * | imageProvider | ) | const [virtual] |
Implements Drawable.
| Rectangle<float> DrawableText::getDrawableBounds | ( | ) | const [virtual] |
Implements Drawable.
const Identifier DrawableText::valueTreeType [static] |