Component
Ploy3D • Docs
Ploy3D / Component
Class: Component
UI控件。
Extends
Extended by
Constructors
new Component()
new Component(
system,canvas,id,options):Component
构造函数。
Parameters
• system: CalynUI
UI系统实例。
• canvas: Canvas
UI画布实例。
• id: number
实例ID。
• options: object & object
可选的初始化数据。
Returns
Overrides
Accessors
active
getactive():boolean
元素是否激活。
setactive(b):void
Parameters
• b: boolean
Returns
boolean
Inherited from
aspect_mode
getaspect_mode():"none"|"width_ctrl"|"height_ctrl"
元素宽高比约束模式。
Returns
"none" | "width_ctrl" | "height_ctrl"
Inherited from
aspect_ratio
getaspect_ratio():number
元素当前宽高比。
Returns
number
Inherited from
children
getchildren():Element[]
子级元素列表。
Returns
Element[]
Inherited from
children_occ_height
getchildren_occ_height():number
子级最大总占用设计高度(包含子级边距,元素自动高度或启用滚动条时需要计算子级最大总占用设计高度)。
Returns
number
Inherited from
children_occ_width
getchildren_occ_width():number
子级最大总占用设计宽度(包含子级边距,元素自动宽度或启用滚动条时需要计算子级最大总占用设计宽度)。
Returns
number
Inherited from
guid
getguid():string
元素GUID。
Returns
string
Inherited from
height
getheight():object
元素当前设计高度。
Returns
object
height
height:
number
内容区域设计高度。
occ_height
occ_height:
number
总占用设计高度(包含边距)。
timestrap
timestrap:
number
数据时间戳。
Inherited from
id
getid():number
元素ID。
Returns
number
Inherited from
style
getstyle():object
样式设置。
Returns
object
bg_fill?
optionalbg_fill:boolean
是否填充背景。
bg_fill_color?
optionalbg_fill_color:string
背景填充颜色。
bg_radii?
optionalbg_radii:number
圆角矩形圆弧半径。
bg_stroke?
optionalbg_stroke:boolean
是否描绘背景边框。
bg_stroke_color?
optionalbg_stroke_color:string
背景边框颜色。
bg_stroke_dash?
optionalbg_stroke_dash:number
背景边框虚线间隔(实线长度为间隔的2倍)。
bg_stroke_width?
optionalbg_stroke_width:number
背景边框线宽。
font?
optionalfont:string
字体。
font_color?
optionalfont_color:string
字体颜色。
font_size?
optionalfont_size:number
字体大小(单位PX)。
Inherited from
type
gettype():"canvas"|"layout"|"panel"|"component"
元素类型("layout","canvas"都派生自"panel",所以可以认为只有两大类"component","panel")。
Returns
"canvas" | "layout" | "panel" | "component"
Inherited from
width
getwidth():object
元素当前设计宽度。
Returns
object
occ_width
occ_width:
number
总占用设计宽度(包含边距)。