Skip to main content
Version: v3

CIRCLE

circle_sample

Draws a circle with support for color, transparency, and other properties.

Creating UI components

const circle = hmUI.createWidget(hmUI.widget.CIRCLE, Param)

Type

Param: object

PropertiesDescriptionRequiredType
center_xCenter of circle x.YESnumber
center_yCenter of circle y.YESnumber
radiusRadius.YESnumber
colorColor 16-increment value.YESnumber
alphaTransparency.[0-255] 0 for full transparencyNOnumber

Code example

Page({
build() {
const circle = hmUI.createWidget(hmUI.widget.CIRCLE, {
center_x: 240,
center_y: 240,
radius: 120,
color: 0xfc6950,
alpha: 200
})
}
})