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 uiNodeui节点 -
circle(centrePoint, r, fill)
-
圆
Name Type Description centrePoint圆心 r半径 fill是否填充 -
circleArc(centrePoint, r, startAngle, endAngle, counterclockwise)
-
圆弧
Name Type Description centrePoint圆心 r半径 startAngle起始角 endAngle结束角 counterclockwiseoptional 方向 -
clear()
-
清除画布
-
ellipse(centrePoint, width, height, rotateAngle, fill)
-
椭圆
Name Type Description centrePointDot 椭圆中心点 widthNumber 长半轴 heightNumber 短半轴 rotateAngleNumber 旋转角 fillBoolean 是否填充 -
foldLine(pointList)
-
根据多个点画折线,可以用此方法实现跟随鼠标
Name Type Description pointListArray Dot数组,即二维数组 -
image(img, left_top_dot)
-
绘制图片
Name Type Description imgImage 图片路径 left_top_dotArray 左上角坐标 -
line(dot1, dot2){Ycc.UI}
-
画线
Name Type Description dot1dot2Returns:
Type Description Ycc.UI -
rect(left_top_dot, right_bottom_dot, fill)
-
矩形
Name Type Description left_top_dotright_bottom_dotfill -
scale(scaleX, scaleY){Ycc.UI}
-
缩放绘图,对之后的所有操作都有效
Name Type Description scaleXscaleYReturns:
Type Description Ycc.UI -
sector(centrePoint, r, startAngle, endAngle, fill, counterclockwise)
-
扇形
Name Type Description centrePoint圆心 r半径 startAngle起始角 endAngle结束角 filloptional 是否填充 counterclockwiseoptional 方向 -
text(positionDot, content, fill){Ycc.UI}
-
文字
Name Type Description positionDotcontentfilloptional Returns:
Type Description Ycc.UI