Class: Toybox.WatchUi.Drawable
- Inherits:
-
Toybox.Lang.Object
Overview
Drawable is the base class of a drawable object.
A Drawable can be constructed using the resource compiler and loaded through the resource (Rez) module.
Direct Known Subclasses
WatchUi.Bitmap, WatchUi.Selectable, WatchUi.Text, WatchUi.TextArea
Instance Member Summary collapse
-
height as Lang.Numeric
The clip height of the Drawable object.
-
identifier as Lang.Object or Null
The ID used to identify the Drawable object.
-
isVisible as Lang.Boolean
The visibility of the Drawable object.
-
locX as Lang.Numeric
The absolute, on-screen x-coordinate of the Drawable object.
-
locY as Lang.Numeric
The absolute, on-screen y-coordinate of the Drawable object.
-
width as Lang.Numeric
The clip width of the Drawable object.
Instance Method Summary collapse
-
draw(dc as Graphics.Dc) as Void
Draw an object to the device context (Dc).
-
initialize(options as { :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.
-
setLocation(x as Lang.Numeric, y as Lang.Numeric) as Void
Set the on-screen location for a Drawable object.
-
setSize(w as Lang.Numeric, h as Lang.Numeric) as Void
Set the size of a Drawable object.
-
setVisible(visible as Lang.Boolean) as Void
Set the visibility of a Drawable object.
Instance Attribute Details
var height as Lang.Numeric
The clip height of the Drawable object.
var identifier as Lang.Object or Null
The ID used to identify the Drawable object.
var isVisible as Lang.Boolean
The visibility of the Drawable object.
var locX as Lang.Numeric
The absolute, on-screen x-coordinate of the Drawable object.
var locY as Lang.Numeric
The absolute, on-screen y-coordinate of the Drawable object.
var width as Lang.Numeric
The clip width of the Drawable object.
Instance Method Details
draw(dc as Graphics.Dc) as Void
Draw an object to the device context (Dc).
This method assumes that the device context has already been configured to the proper options.
Derived classes should check the isVisible property, if it exists, before trying to draw.
initialize(options as { :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
The option :visible
is only supported with ConnectIQ 3.3.0 and later.
setLocation(x as Lang.Numeric, y as Lang.Numeric) as Void
Set the on-screen location for a Drawable object.
setSize(w as Lang.Numeric, h as Lang.Numeric) as Void
Set the size of a Drawable object.
setVisible(visible as Lang.Boolean) as Void
Set the visibility of a Drawable object.