Skip to main content
Version: v3.x

IMG_POINTER

Pointer component based on IMG image component.

Create UI widget

const imgPointer = hmUI.createWidget(hmUI.widget.IMG_POINTER, Param)

Type

Param: object

PropertiesDescriptionRequiredType
xThe center of rotation of the pointer itself, x offset.YESnumber
yThe center of rotation of the pointer itself, y offset.YESnumber
angleRotation angle of the image, 0 degrees in the 12-point direction.NOnumber
center_xCenter of rotation of the image.YESnumber
center_yCenter of rotation of the image.YESnumber
srcPath to the image.YESstring

Code example

const imgPointer = hmUI.createWidget(hmUI.widget.IMG_POINTER, {
src: rootPath + 'hour.png',
center_x: 227,
center_y: 227,
x: 22,
y: 121,
angle: 245
})