形状-shape

描述

形状,父对象为ui,无子对象


事件

  • userevent: 当订阅了某自定义事件,通过service.ctl.emitEvent(name, value)广播时触发, 事件函数定义: onUserEvent(name,value),参数name为事件名,value为数据

属性

名称 功能说明 脚本例子
geometryLocked 区域锁定,锁定后控件的位置及大小不能修改
x x坐标 (只读属性) var x = ui.form-name.shape-name.x; 获取对象的x坐标
y y坐标 (只读属性) var y = ui.form-name.shape-name.y; 获取对象的y坐标
width 宽 (只读属性) var width = ui.form-name.shape-name.width; 获取对象的宽
height 高 (只读属性) var height = ui.form-name.shape-name.width; 获取对象的高
enabled 使能:如果选中,对象处于激活状态,否则处于“禁止”状态,对所有触摸操作无反应。 ui.form-name.shape-name.enabled=0 禁止对象
visible 可见:如果选中,对象可见,否则隐藏 ui.form-name.shape-name.visible=0 隐藏对象
type 类型:0-Line,1-Rectangle,2-Ellipse,3-Triangle ui.form-name.shape-name.type=0 设置形状为线
lineEndAStyle 线端点A风格:0-No_Style, 1-Arrow, 2-Square, 3-Circle ui.form-name.shape-name.lineEndAStyle=1 设置端点A为箭头
lineEndBStyle 线端点B风格:0-No_Style, 1-Arrow, 2-Square, 3-Circle ui.form-name.shape-name.lineEndBStyle=1 设置端点B为箭头
cornerRadius 圆角半径,单位:像素 ui.form-name.shape-name.cornerRadius=10 设置圆角半径为10像素
direction 方向:0-Clock_12, 1-Clock_3, 2-Clock_6, 3-Clock_9 ui.form-name.shape-name.direction=1 设置图形的方向为3点种方向
lineStyle 线风格:0-No_Pen, 1-Solid, 2-Dash, 3-Dot, 4-Dash-Dot, 5-DashDotDot ui.form-name.shape-name.lineStyle=1 设置图形线为实线
lineWeight 线粗,单位:像素 ui.form-name.shape-name.lineWeight=10 设置线粗10像素
lineColor 线颜色,颜色定义参看 控件对象 ui.form-name.shape-name.lineColor='#0000ff' 设置线为蓝色
fillingColor 填充颜色,颜色定义参看 控件对象 ui.form-name.shape-name.fillingColor='#ff0000' 设置填充色为红色
fillingColorType 填充色类型:0-Linear_A, 1-Linear_B, 2-Radial_A, 3-Radial_B, 4-Radial_Center, 5-Pure, 6-No_Color可选 ui.form-name.shape-name.fillingColorType=0 设置填充色类型为Linear_A
antiAliasing 反锯齿显示 ui.form-name.shape-name.antiAliasing=1 使能反锯齿显示
effect 显示效果:0-None, 1-Shadow, 2-Blur ui.form-name.shape-name.effect=1 显示效果为Shadow
blurRadius 模糊半径 ui.form-name.shape-name.blurRadius=2 设置模糊半径为2

方法

名称 功能说明 脚本例子
move(x,y) 移动对象:将对象移动到(x,y)坐标位置,坐标系的原点在屏幕的左上角。 ui.form-name.shape-name.move(10,10) 移动对象到坐标(10,10)
resize(width, height) 设置对象宽和高 ui.form-name.shape-name.resize(30,20) 设置对象宽30像素,高20像素

results matching ""

    No results matching ""