{{tag>dragonscript behavior}} [[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorSky** * [[behaviors_use_cases|Behaviors Explained: By Use-Case]] * [[behaviors_a_to_z|Behaviors Explained: From A to Z]] ====== ECBehaviorSky ====== Behavior element behavior adding sky support. Adds a SkyInstance resources to the world with support to mainpulate controllers. If a playback controller is set it is updated with the elapsed time. Other behaviors can update individual named controllers to add special effects. Multiple skies can be added to a game world by different elements. In this case the graphic module concatenates them as if one single sky is used. This allows to split skies into multiple sky instances to add individual effects easily. To ensure the correct drawing order each sky is required to have a unique order value. Higher order values are rendered ontop of lower order values. ====== Instance Counts ====== This behavior can be used only once on an element. ====== Element Class Properties ====== Element class properties have the prefix ''sky.'' . ===== path ===== Set path to sky resource to use. * Full name: ''sky.path'' * Type: string * Default Value: empty string * Expected File Pattern: ''*.desky'' * Example (*.deeclass) default.desky ===== order ===== Set order. Sky instances with higher order are rendered over sky instances with lower order. * Full name: ''sky.order'' * Type: integer * Default Value: ''0'' * Example (*.deeclass) 1 ===== controllerPlayback ===== Set name of playback controller or empty string if not used. * Full name: ''sky.controllerPlayback'' * Type: string * Default Value: empty string * Example (*.deeclass) playback ====== Events ====== This behavior has no events. ====== Required Behaviors ====== This behavior requires no other behaviors. ====== Optional Behaviors ====== This behavior does not support optional behaviors. ====== Persistency ====== This behavior does support element class to be persistable (setPersistable). ====== API Documentation ====== #@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorSky.html,ECBehaviorSky~@#. Since DragonScript Module Version ''1.0'' ====== Use Cases ====== * Add sky to game world. ====== Element Class Example ====== This example defines an element which adds a sky. class MyElement extends BehaviorElementClass public var ECBehaviorSky sky func new() sky = ECBehaviorSky.new(this) end end ====== Behavior Factory ====== Using element class supporting adding behaviors the behavior can be added like this: 0 1 4 default.desky ====== Live Examples ====== * [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]