Package | com.yworks.canvas.drawing |
Class | public class SimpleTextPaintable |
Inheritance | SimpleTextPaintable AbstractTextPaintable Object |
DisplayObject
.
Method | Defined By | ||
---|---|---|---|
SimpleTextPaintable(textFormat:UITextFormat, p:IPoint)
Constructor. | SimpleTextPaintable | ||
[override]
Returns a tight rectangular area where the whole rendering
would fit into. | SimpleTextPaintable | ||
[static]
Creates a dynamic display object creator that renders the string in its created DisplayObject
using the textFormat at the given location. | AbstractTextPaintable | ||
createDisplayObject(context:IDisplayObjectContext):DisplayObject | AbstractTextPaintable | ||
[override]
| SimpleTextPaintable | ||
updateDisplayObject(oldDisplayObject:DisplayObject, context:IDisplayObjectContext):DisplayObject | AbstractTextPaintable |
SimpleTextPaintable | () | Constructor |
public function SimpleTextPaintable(textFormat:UITextFormat, p:IPoint)
Constructor.
ParameterstextFormat:UITextFormat — The text format to use for the text
| |
p:IPoint — Where to draw the text (top left anchor point).
|
calculateBounds | () | method |
override public function calculateBounds(scratch:IMutableRectangle, ctx:ICanvasContext):IRectangle
Returns a tight rectangular area where the whole rendering would fit into.
Implementations can use the scratch
rectangle to put their
results in and return it as the result of the operation.
Client has to always provide a non-null
instance as
a parameter. They may however decide to return an internally
cached or dynamically created IRectangle
implementation and
disregard the scratch parameter.
If calculating the bounds is too expensive or the painting is not
bound to a certain area, this method may return null
.
If nothing is painted, this method should return an empty rectangle, where
either or both the width and height is non-positive or
ImmutableRectangle.Empty
.
Parameters
scratch:IMutableRectangle — An instance that can optionally be used to fill with the
corresponding values and be returned
| |
ctx:ICanvasContext — The context to calculate the bounds for (currently not used)
|
IRectangle — The bounds or null to indicate an unbound area
|
paint | () | method |
override public function paint(g:YGraphics, ctx:IPaintContext):void
Parameters
g:YGraphics | |
ctx:IPaintContext |