Skip to main content
Version: v3

IMG_POINTER

The widget area is full screen. The widget uses a picture to achieve a pointer rotation effect by setting its rotation center and rotation angle.

The data progress can be displayed by binding the data type hmUI.data_type.*.

Create UI widget

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

Type

Param: object

PropertiesDescriptionRequiredType
srcImage path, the name of the file in the /assets directory (relative path)YESstring
xPointer to the image's own center of rotation x coordinatesYESnumber
yThe y-coordinate of the center of rotation of the pointer image itselfYESnumber
center_xWidget rotation center x coordinatesYESnumber
center_yWidget rotation center y coordinatesYESnumber
angleImage rotation angle, 0 degrees in 12-point directionNOnumber
start_angleStart angle of the rotation range, default 0NOnumber
end_angleEnd angle of the rotation range, default 360NOnumber
typeBinding data type, see hmUI.data_typeNOnumber
invalid_visibleWhen setting type, whether or not to show the pointer if it is invalid data, default trueNOnumber

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
})