Class: $.ComplicationDrawable
- Inherits:
-
WatchUi.Drawable
-
WatchUi.Drawable
-
Overview
Drawable that contains the complication text. This drawable is always drawn centered horizontally on the screen. When the drawable is being configured by the watch face editor, the (x,y) location must be the top left corner of the drawable.
Instance Member Summary collapse
-
_centerY as Lang.Numeric
The y coordinate of the center of the drawable.
-
_color as Graphics.ColorType
The color of the text.
-
_font as Graphics.FontType
The font to use for the text.
-
_text as Lang.String
The text to display.
Instance Method Summary collapse
-
calculateTextDimensions(dc as Graphics.Dc) as Void
Calculate the dimensions of the text.
-
containsPoint(x as Lang.Number, y as Lang.Number) as Lang.Boolean
Check if the drawable contains the given point.
-
draw(dc as Graphics.Dc) as Void
Draw the complication.
-
getBoundingBox() as Graphics.BoundingBox
Get the bounding box that encapsulates the drawable.
-
initialize(options as { :text as Lang.String or Lang.ResourceId, :color as Graphics.ColorType, :backgroundColor as Graphics.ColorType, :font as Graphics.FontType, :justification as Graphics.TextJustification or Lang.Number, :identifier as Lang.Object, :locX as Lang.Numeric, :locY as Lang.Numeric, :width as Lang.Numeric, :height as Lang.Numeric, :visible as Lang.Boolean })
Constructor.
-
setColor(color as Graphics.ColorType) as Void
Set the text color.
-
setText(text as Lang.String) as Void
Set the text to display.
Instance Attribute Details
var _centerY as Lang.Numeric
The y coordinate of the center of the drawable
var _color as Graphics.ColorType
The color of the text
var _font as Graphics.FontType
The font to use for the text
var _text as Lang.String
The text to display
Instance Method Details
calculateTextDimensions(dc as Graphics.Dc) as Void
Calculate the dimensions of the text
containsPoint(x as Lang.Number, y as Lang.Number) as Lang.Boolean
Check if the drawable contains the given point
draw(dc as Graphics.Dc) as Void
Draw the complication
getBoundingBox() as Graphics.BoundingBox
Get the bounding box that encapsulates the drawable
initialize(options as { :text as Lang.String or Lang.ResourceId, :color as Graphics.ColorType, :backgroundColor as Graphics.ColorType, :font as Graphics.FontType, :justification as Graphics.TextJustification or Lang.Number, :identifier as Lang.Object, :locX as Lang.Numeric, :locY as Lang.Numeric, :width as Lang.Numeric, :height as Lang.Numeric, :visible as Lang.Boolean })
Constructor
setColor(color as Graphics.ColorType) as Void
Set the text color
setText(text as Lang.String) as Void
Set the text to display