- 最后登录
- 2024-6-3
- 注册时间
- 2009-10-16
- 阅读权限
- 100
- 积分
- 18803
- 纳金币
- 17488
- 精华
- 1
|
Progress Bar (External Behavior)
Summary
Control a property of the parent object based on the percent done of another object.
Category
Latest Behaviors
Author
Gavin Kistner
Difficulty
(Reference)
Time to Complete
5 Minutes
Downloads
Click Here
to download the associated files.
(This document covers version 0.8.1 of the 'Progress Bar' behavior, current as of 2005-Feb-11)
Description
Place this behavior on an object that you want to change as another object is loading data dynamically. As the
Loader Object
fires
onLoadProgress
events, this behavior will modify the parent object, setting the property specified by
Property Name
to a value between the
Min Value
and
Max Value
that you specify, based on how far the load has progressed.
If the
Start At Min?
advanced property is checked, this behavior will automatically set the property to
Min Value
as soon as the behavior loads.
If
Show Percent?
is checked, this behavior will update the contents of another text object (chosen with the
Pct Text
property) to be a string showing the percent complete. (The percent will always be an integer, such as “47%”.)
The common case is to set the property to something like a scale value, and set the
Loader Object
to a Preload Module behavior, to cause a progress bar to grow as the module loads. However, this behavior can really be attached to any object: you can cause the light level to slowly rise as models load (set the
brightness
of a Point light), cause an object to spin faster and faster (set the
rotationVelocity.x
property), and so on.
Basic Properties
Loader Object
The object which will be firing onLoadProgress events.
Property
The script name of the property on the parent to control.
Min Value
The value of the property when at 0% loaded.
Max Value
The value of the property when at 100% loaded.
Advanced Properties
Start at Min?
Initialize the property to be the minimum value?
Show Percent?
Update a text object with percent information?
Pct Text
The Text object whose string should be updated with percent information.
Actions
Set Percent
Set the progress bar to a specific percent.
Percent
The percent to set the progress bar to.
Demonstration
View Demonstration Project
Download Project File
|
|