Skip to main content
Version: v3

IMG_LEVEL

Given an array of pictures, display the corresponding pictures according to the progress (the level property).

Create UI widget

const imgLevel = hmUI.createWidget(hmUI.widget.IMG_LEVEL, Param)

Type

Param: object

PropertiesDescriptionRequiredType
xThe x-coordinate of component.Yesnumber
yThe y-coordinate of component.Yesnumber
image_arrayArray of images.YesArray<string>
image_lengthSize of array.yesnumber
wThe width of the component.(optional)NOnumber
hThe height of the component.(optional)NOnumber
levelPicture drawn [0-image_length]NOnumber

-If one of w / h is not written, it will go to image_array to read the width and height of the image as the width and height of the component.

Code example

const imgArray = ['1.png', '2.png', '3.png']
const imgLevel = hmUI.createWidget(hmUI.widget.IMG_LEVEL, {
x: 0,
y: 0,
w: 480,
h: 480,
image_array: imgArray,
image_length: 3,
level: 2 //level is 2.Draw the second picture.
})