Class: $.ComplicationDrawable

Inherits:
WatchUi.Drawable show all

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

Instance Method Summary collapse

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

Parameters:

  • dc —

    The drawing context

containsPoint(x as Lang.Number, y as Lang.Number) as Lang.Boolean

Check if the drawable contains the given point

Parameters:

  • x —

    The x coordinate

  • y —

    The y coordinate

draw(dc as Graphics.Dc) as Void

Draw the complication

Parameters:

  • dc —

    The drawing context

getBoundingBox() as Graphics.BoundingBox

Get the bounding box that encapsulates the drawable

Returns:

  • the bounding box for 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

Parameters:

  • color —

    The text color

setText(text as Lang.String) as Void

Set the text to display

Parameters:

  • text —

    The complication text


Generated Oct 20, 2026, 8:20:32 AM