A drawable object which renders a line of text.
- See also
- Drawable
|
| | DrawableText ()=default |
| | Creates a DrawableText object.
|
| void | setText (const String &newText) |
| | Sets the text to display.
|
| void | setPreserveWhitespace (bool shouldPreserveWhitespace) |
| | Sets whether whitespace should always be preserved when drawing.
|
| const String & | getText () const noexcept |
| | Returns the currently displayed text.
|
| void | setColour (Colour newColour) |
| | Sets the colour of the text.
|
| void | setFill (const FillType &newFill) |
| | Sets a fill type for the text.
|
| Colour | getColour () const noexcept |
| | Returns the current text colour.
|
| void | setStrokeOptions (const StrokeOptions &newStrokeOptions) |
| | Changes the properties of the outline that will be drawn around the text.
|
| const StrokeOptions & | getStrokeOptions () |
| | Returns the currently specified stroke attributes.
|
| void | setFont (const Font &newFont, bool applySizeAndScale) |
| | Sets the font to use.
|
| const Font & | getFont () const noexcept |
| | Returns the current font.
|
| void | setJustification (Justification newJustification) |
| | Changes the justification of the text within the bounding box.
|
| Justification | getJustification () const noexcept |
| | Returns the current justification.
|
| Parallelogram< float > | getBoundingBox () const noexcept |
| | Returns the parallelogram that defines the text bounding box.
|
| void | setBoundingBox (Parallelogram< float > newBounds) |
| | Sets the bounding box that contains the text.
|
| bool | hitTest (Point< float > p) const override |
| | Tests whether a given point is inside the Drawable.
|
| float | getFontHeight () const noexcept |
| void | setFontHeight (float newHeight) |
| float | getFontHorizontalScale () const noexcept |
| void | setFontHorizontalScale (float newScale) |
| std::unique_ptr< Drawable > | createCopy () const override |
| | Creates a deep copy of this Drawable object.
|
| Rectangle< float > | getDrawableBoundsUntransformed () const override |
| | Returns the area that this drawable covers in its original coordinate system.
|
| Path | getOutlineAsPath () const override |
| | Creates a path that describes the outline of this drawable.
|
| bool | replaceColour (Colour originalColour, Colour replacementColour) override |
| | Recursively replaces a colour that might be used for filling or stroking.
|
| std::optional< String > | getContainedText () const override |
| | Drawable ()=default |
| | Constructor.
|
| | Drawable (const Drawable &other) |
| | Copy constructor.
|
| virtual | ~Drawable ()=default |
| | Destructor.
|
| void | draw (Graphics &g, float opacity, const AffineTransform &transform=AffineTransform()) const |
| | Renders this Drawable object.
|
| void | drawAt (Graphics &g, float x, float y, float opacity) const |
| | Renders the Drawable at a given offset within the Graphics context.
|
| void | drawWithin (Graphics &g, Rectangle< float > destArea, RectanglePlacement placement, float opacity) const |
| | Renders the Drawable within a rectangle, scaling it to fit neatly inside without changing its aspect-ratio.
|
| void | setClipPath (std::unique_ptr< Drawable > drawableClipPath) |
| | Sets a the clipping region of this drawable using another drawable.
|
| Rectangle< float > | getDrawableBounds () const |
| | Returns the area that this drawable covers.
|
| Rectangle< float > | getContentBounds () const |
| | Returns the bounds that this drawable is intended to occupy.
|
| virtual Rectangle< float > | getContentBoundsUntransformed () const |
| | Returns the area that this drawable is intended to occupy in its original coordinate system.
|
| int | getWidth () const |
| | Returns the width of the drawable bounds rounded up to the nearest integer.
|
| int | getHeight () const |
| | Returns the height of the drawable bounds rounded up to the nearest integer.
|
| void | setDrawableTransform (const AffineTransform &transform) |
| | Sets a transformation that applies to the same coordinate system in which the rest of the draw calls are made.
|
| void | setDrawableTransformToFit (const Rectangle< float > &area, RectanglePlacement placement) |
| | Calls setDrawableTransform() with a transform that will position this Drawable within the specified area in the untransformed coordinate system of the Drawable.
|
| AffineTransform | getDrawableTransform () const |
| | Returns the transform that is currently being applied to this drawable.
|
| const String & | getName () const |
| | Returns the name of this Drawable object.
|
| void | setName (const String &newName) |
| | Sets the name of this drawable object.
|
| void | addListener (Listener *newListener) |
| | Adds a listener.
|
| void | removeListener (Listener *listenerToRemove) |
| | Removes a listener.
|
| virtual bool | isImage () const |
| virtual bool | requiresBlendBuffer () const |