Skip to content
ProgressBar

界面 / ProgressBar

ProgressBar Class

进度条

Hierarchy

Table of contents

Properties

click

Properties

onCustomPropertyChange: Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> client
监听自定义属性同步事件

Accessors

backgroundImageColor(): Readonly<LinearColor> client
获取背景图片颜色
backgroundImageDrawType(): Readonly<SlateBrushDrawType> client
获取背景图片绘制类型
backgroundImageGuid(): string client
获取背景图片id
backgroundImageMargin(): Readonly<Margin> client
获取进度条背景图片边距
backgroundImageSize(): Readonly<Vector2> client
获取背景图片大小
barThickness(): number client
获取进度条厚度
currentValue(): number client
获取当前值
fillImageColor(): Readonly<LinearColor> client
获取填充图片颜色
fillImageDrawType(): Readonly<SlateBrushDrawType> client
获取填充图片绘制类型
fillImageGuid(): string client
获取填充区图片id
fillImageMargin(): Readonly<Margin> client
获取进度条图片边距
fillImageSize(): Readonly<Vector2> client
获取填充图片大小
fillType(): ProgressBarFillType client
获取进度条填充的方式
isRoundedToInt(): boolean client
获取当前数值是否取整
onSliderValueChanged(): MulticastDelegate<(CurrentValue: number) => void> client
Slider值变化事件
percent(): number client
获取当前百分比
slideMethod(): SlideMethod client
获取进度条的滑动方式
sliderButtonPressDelegate(): MulticastDelegate<(CurrentValue: number) => void> client
Slider按下事件
sliderButtonReleaseDelegate(): MulticastDelegate<(CurrentValue: number) => void> client
Slider抬起事件
sliderMaxValue(): number client
获取拖动条最大值
sliderMinValue(): number client
获取拖动条最小值
thumbImageColor(): Readonly<LinearColor> client
获取滑块图片颜色
thumbImageDrawType(): Readonly<SlateBrushDrawType> client
获取滑块图片绘制类型
thumbImageGuid(): string client
获取填充区图片id
thumbImageMargin(): Readonly<Margin> client
获取拖动条图片边距
thumbImageSize(): Readonly<Vector2> client
获取滑块图片大小
click

Accessors

alignPosition(): Readonly<Vector2> client
获取控件的对齐位置,在对齐方式为靠右对齐、靠下对齐、中心对齐时,alignPosition的值与positon不同;
autoSizeHorizontalEnable(): boolean client
获取是否自动水平设置大小
autoSizeVerticalEnable(): boolean client
获取是否自动垂直设置大小
cachedGeometry(): Geometry client
获取上一次的GetTickSpaceGeometry
constraints(): Readonly<UIConstraintAnchors> client
获取控件的布局
desiredSize(): Vector2 client
获取期望大小
enable(): boolean client
是否可用
guid(): string client
获取控件GUID
isHovered(): boolean client
是否是hovered
mouseCursor(): MouseCursor client
获取控件上光标类型
name(): string client
获取名字
paintSpaceGeometry(): Geometry client
获取最后一次用于渲染Widget的几何信息
parent(): Widget client
获取父节点
pivot(): Vector2 client
获取控件锚点位置,这个属性决定了控件图形与锚点的相对位置;(0,0)时,锚点位于控件左上角;(0.5,0.5)时,锚点位于控件正中心
position(): Readonly<Vector2> client
获取控件的位置
renderOpacity(): number client
获取渲染透明度
renderScale(): Vector2 client
获取渲染缩放
renderShear(): Vector2 client
获取渲染错切形变
renderTransformAngle(): number client
获取渲染的角度
renderTransformPivot(): Vector2 client
获取渲染锚点
size(): Vector2 client
获取大小
tickSpaceGeometry(): Geometry client
获取最后一次用于驱动Widget Tick的几何信息
transform(): Readonly<UITransform> client
得到控件的大小和位置
visibility(): SlateVisibility client
获取可见性
visible(): boolean client
是否可见
zOrder(): number client
获取zorder

Methods

newObject(parent?: Canvas, inName?: string): ProgressBar client
创建 ProgressBar 控件
click

Methods

addChild(child: Widget): void client
添加子节点
clone(position: Vector2, Parent?: Widget): Widget client
克隆UI控件及其子节点到指定父控件位置(默认到其父节点)
destroyObject(): void client
立刻移除并销毁 不可以在使用
equal(that: Widget): boolean client
判断是不是同一个对象
findChildByPath(inPath: string): Widget client
通过相对路径查找节点
getChildAt(index: number): Widget client
获取第几位子节点
getChildByName<T: extends Widget<T>>(name: string): T: extends Widget<T> client
通过名字查找节点
getChildrenCount(): number client
获取子节点数量
getCustomProperties(): string[] client
获取所有自定义属性
getCustomProperty<T: extends CustomPropertyType>(propertyName: string): T: extends CustomPropertyType client
获取自定义属性
getCustomPropertyChangeDelegate(property): Readonly<MulticastDelegate<(path: string, value: unknown, oldValue: unknown) => void>> client
给定对象属性修改时触发的事件代理
invalidateLayoutAndVolatility(): void client
立刻触发重新渲染的和排布计算
removeAllChildren(): void client
清除所有子节点,会销毁UI无法再使用
removeChild(child: Widget): void client
移除节点,会销毁UI无法在使用
removeChildAt(index: number): void client
移除第几个节点,会销毁UI无法再使用
removeObject(): void client
立刻移除并添加到根节点 可以再使用
serialize(): string client
序列化UI控件
setCustomProperty(propertyName: string, value: undefined CustomPropertyType): void client
设置自定义属性
deserialize(Data: string, Parent?: Widget): Widget client
反序列化UI

Properties

Accessors


backgroundImageColor

get backgroundImageColor(): Readonly<LinearColor> client

set backgroundImageColor(inColor): void client

获取背景图片颜色

Returns

Readonly<LinearColor>背景图片颜色,Type.LinearColor类型,数据范围0~1

设置背景图片颜色

Parameters

inColor LinearColor背景颜色,Type.LinearColor类型,数据范围0~1

backgroundImageDrawType

get backgroundImageDrawType(): Readonly<SlateBrushDrawType> client

set backgroundImageDrawType(InDrawType): void client

获取背景图片绘制类型

Returns

Readonly<SlateBrushDrawType>背景图片绘制类型

设置背景图片绘制类型

Parameters

InDrawType SlateBrushDrawTypeBrush类型

backgroundImageGuid

get backgroundImageGuid(): string client

set backgroundImageGuid(inGUID): void client

获取背景图片id

Returns

string背景图片id

设置进度条背景图片

Parameters

inGUID string图片GUID

void


backgroundImageMargin

get backgroundImageMargin(): Readonly<Margin> client

set backgroundImageMargin(inMargin): void client

获取进度条背景图片边距

Returns

Readonly<Margin>进度条背景图片边距

设置进度条背景图片边距

Parameters

inMargin Margin进度条背景图片边距

backgroundImageSize

get backgroundImageSize(): Readonly<Vector2> client

set backgroundImageSize(inSize): void client

获取背景图片大小

Returns

Readonly<Vector2>图片大小

设置背景图片大小

Parameters

inSize Vector2图片大小

barThickness

get barThickness(): number client

set barThickness(inputBarThickness): void client

获取进度条厚度

Returns

number厚度

设置进度条厚度

Parameters

inputBarThickness number厚度

currentValue

get currentValue(): number client

set currentValue(inValue): void client

获取当前值

Returns

number当前值

设置当前值

Parameters

inValue number当前值

void


fillImageColor

get fillImageColor(): Readonly<LinearColor> client

set fillImageColor(inColor): void client

获取填充图片颜色

Returns

Readonly<LinearColor>填充图片颜色,Type.LinearColor类型,数据范围0~1

设置填充图片颜色

Parameters

inColor LinearColor设置的颜色,Type.LinearColor类型,数据范围0~1

fillImageDrawType

get fillImageDrawType(): Readonly<SlateBrushDrawType> client

set fillImageDrawType(inDrawType): void client

获取填充图片绘制类型

Returns

Readonly<SlateBrushDrawType>填充图片绘制类型

设置填充图片绘制类型

Parameters

inDrawType SlateBrushDrawType填充类型

fillImageGuid

get fillImageGuid(): string client

set fillImageGuid(inGUID): void client

获取填充区图片id

Returns

string填充区图片id

设置进度条图片

Parameters

inGUID string图片GUID

void


fillImageMargin

get fillImageMargin(): Readonly<Margin> client

set fillImageMargin(inMargin): void client

获取进度条图片边距

Returns

Readonly<Margin>进度条图片边距

设置进度条图片边距

Parameters

inMargin Margin进度条图片边距

fillImageSize

get fillImageSize(): Readonly<Vector2> client

set fillImageSize(inSize): void client

获取填充图片大小

Returns

Readonly<Vector2>图片大小

设置填充图片大小

Parameters

inSize Vector2大小

fillType

get fillType(): ProgressBarFillType client

set fillType(inType): void client

获取进度条填充的方式

Returns

ProgressBarFillType进度条填充

设置进度条填充的方式

Parameters

inType ProgressBarFillType{ 从左到右,从右到左,从上到下,从下到上 }

void


isRoundedToInt

get isRoundedToInt(): boolean client

set isRoundedToInt(inToInt): void client

获取当前数值是否取整

Returns

boolean当前数值是否取整

设置当前数值是否取整

Parameters

inToInt boolean是否取整

void


onSliderValueChanged

get onSliderValueChanged(): MulticastDelegate<(CurrentValue: number) => void> client

Slider值变化事件

Returns

MulticastDelegate<(CurrentValue: number) => void>变化事件

percent

get percent(): number client

set percent(inPercent): void client

获取当前百分比

Returns

number当前百分比

设置当前百分比

Parameters

inPercent number百分比

void


slideMethod

get slideMethod(): SlideMethod client

set slideMethod(inSlideMethod): void client

获取进度条的滑动方式

Returns

SlideMethod

设置进度条的滑动方式

Parameters

inSlideMethodSlideMethod

sliderButtonPressDelegate

get sliderButtonPressDelegate(): MulticastDelegate<(CurrentValue: number) => void> client

Slider按下事件

Returns

MulticastDelegate<(CurrentValue: number) => void>按下事件

sliderButtonReleaseDelegate

get sliderButtonReleaseDelegate(): MulticastDelegate<(CurrentValue: number) => void> client

Slider抬起事件

Returns

MulticastDelegate<(CurrentValue: number) => void>抬起事件

sliderMaxValue

get sliderMaxValue(): number client

set sliderMaxValue(inValue): void client

获取拖动条最大值

Returns

number拖动条最大值

设置拖动条的最大值

Parameters

inValue number拖动条最大值

void


sliderMinValue

get sliderMinValue(): number client

set sliderMinValue(inValue): void client

获取拖动条最小值

Returns

number拖动条最小值

设置拖动条的最小值

Parameters

inValue number拖动条最小值

void


thumbImageColor

get thumbImageColor(): Readonly<LinearColor> client

set thumbImageColor(inColor): void client

获取滑块图片颜色

Returns

Readonly<LinearColor>滑块图片颜色,Type.LinearColor类型,数据范围0~1

设置滑块图片颜色

Parameters

inColor LinearColor设置的颜色,Type.LinearColor类型,数据范围0~1

thumbImageDrawType

get thumbImageDrawType(): Readonly<SlateBrushDrawType> client

set thumbImageDrawType(inDrawType): void client

获取滑块图片绘制类型

Returns

Readonly<SlateBrushDrawType>滑块图片绘制类型

设置滑块图片绘制类型

Parameters

inDrawType SlateBrushDrawType绘制类型

thumbImageGuid

get thumbImageGuid(): string client

set thumbImageGuid(inGUID): void client

获取填充区图片id

Returns

string填充区图片id

设置拖动条的样式

Parameters

inGUID string拖动条样式GUID

void


thumbImageMargin

get thumbImageMargin(): Readonly<Margin> client

set thumbImageMargin(inMargin): void client

获取拖动条图片边距

Returns

Readonly<Margin>拖动条图片边距

设置拖动条图片边距

Parameters

inMargin Margin拖动条图片边距

thumbImageSize

get thumbImageSize(): Readonly<Vector2> client

set thumbImageSize(inSize): void client

获取滑块图片大小

Returns

Readonly<Vector2>图片大小

设置滑块图片大小

Parameters

inSize Vector2滑块图片大小

Methods


newObject

Static newObject(parent?, inName?): ProgressBar client

创建 ProgressBar 控件

Parameters

parent? Canvas创建控件的外parent对象 default:null
inName? string创建控件的名称 default:null range:设置合理的名称即可

Returns

ProgressBar创建的对象

当parent和inName与已有的对象相同时,旧的对象会被销毁