Class: UI

Ycc. UI

new Ycc.UI(yccInstance)

UI类,提供绘图基本的原子图形和组合图形。 每个UI类的对象都跟一个Ycc绑定。
Name Type Description
yccInstance Ycc

Classes

Base
BrokenLine
Circle
ComponentButton
CropRect
Ellipse
Image
ImageFrameAnimation
Line
MultiLineText
Polygon
Rect
ScrollerRect
SingleLineText

Members

ctx

当前绘图环境

ctxHeight

当前绘图环境的高

ctxWidth

当前绘图环境的宽

Methods

staticYcc.UI.release(uiNode)

递归释放内存,等待GC 将所有引用属性设为null
Name Type Description
uiNode ui节点

circle(centrePoint, r, fill)

Name Type Description
centrePoint 圆心
r 半径
fill 是否填充

circleArc(centrePoint, r, startAngle, endAngle, counterclockwise)

圆弧
Name Type Description
centrePoint 圆心
r 半径
startAngle 起始角
endAngle 结束角
counterclockwise optional 方向
清除画布

ellipse(centrePoint, width, height, rotateAngle, fill)

椭圆
Name Type Description
centrePoint Dot 椭圆中心点
width Number 长半轴
height Number 短半轴
rotateAngle Number 旋转角
fill Boolean 是否填充

foldLine(pointList)

根据多个点画折线,可以用此方法实现跟随鼠标
Name Type Description
pointList Array Dot数组,即二维数组

image(img, left_top_dot)

绘制图片
Name Type Description
img Image 图片路径
left_top_dot Array 左上角坐标

line(dot1, dot2){Ycc.UI}

画线
Name Type Description
dot1
dot2
Returns:
Type Description
Ycc.UI

rect(left_top_dot, right_bottom_dot, fill)

矩形
Name Type Description
left_top_dot
right_bottom_dot
fill

scale(scaleX, scaleY){Ycc.UI}

缩放绘图,对之后的所有操作都有效
Name Type Description
scaleX
scaleY
Returns:
Type Description
Ycc.UI

sector(centrePoint, r, startAngle, endAngle, fill, counterclockwise)

扇形
Name Type Description
centrePoint 圆心
r 半径
startAngle 起始角
endAngle 结束角
fill optional 是否填充
counterclockwise optional 方向

text(positionDot, content, fill){Ycc.UI}

文字
Name Type Description
positionDot
content
fill optional
Returns:
Type Description
Ycc.UI