Skip to main content
Version: v3

CIRCLE

Start from API_LEVEL 2.0 . Please refer to API_LEVEL.

circle_sample

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

Creating UI widgets

import { createWidget, widget } from '@zos/ui'

const circle = createWidget(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

import { createWidget, widget } from '@zos/ui'

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