IMG_POINTER
Pointer component based on IMG image component.
Create UI widget
const imgPointer = hmUI.createWidget(hmUI.widget.IMG_POINTER, Param)
Type
Param: object
| Properties | Description | Required | Type |
|---|---|---|---|
| x | The center of rotation of the pointer itself, x offset. | YES | number |
| y | The center of rotation of the pointer itself, y offset. | YES | number |
| angle | Rotation angle of the image, 0 degrees in the 12-point direction. | NO | number |
| center_x | Center of rotation of the image. | YES | number |
| center_y | Center of rotation of the image. | YES | number |
| src | Path to the image. | YES | string |
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
})