User Tools

Site Tools


dragengine:modules:dragonscript:behavior_outline

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
dragengine:modules:dragonscript:behavior_outline [2020/05/24 13:11] dragonlorddragengine:modules:dragonscript:behavior_outline [2020/05/24 14:20] dragonlord
Line 3: Line 3:
 [[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorOutline** [[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[abstractions#behavior_elementsquick_and_easy_development|Behavior Elements: Quick and Easy Development]] >> **ECBehaviorOutline**
 </WRAP> </WRAP>
 +
 +  * [[behaviors_use_cases|Behaviors Explained: By Use-Case]]
 +  * [[behaviors_a_to_z|Behaviors Explained: From A to Z]]
  
 ====== ECBehaviorOutline ====== ====== ECBehaviorOutline ======
Line 52: Line 55:
 Multiple instances of ECBehaviorOutline can be used for example to create different outlines to switch on and off or to add multiple outline skins to a single ECBehaviorComponent. Keep in mind though that each instance of ECBehaviorOutline creates a new component and dynamic skin resource which can impact performance if the used model has high polygon count. To use multiple instances use code like this in your subclass constructor: Multiple instances of ECBehaviorOutline can be used for example to create different outlines to switch on and off or to add multiple outline skins to a single ECBehaviorComponent. Keep in mind though that each instance of ECBehaviorOutline creates a new component and dynamic skin resource which can impact performance if the used model has high polygon count. To use multiple instances use code like this in your subclass constructor:
 <code> <code>
-class MyElement extends BehaviorElementClass+class MultiInstanceClass extends BehaviorElementClass
   public var ECBehaviorComponent component   public var ECBehaviorComponent component
   public var ECBehaviorCollider collider   public var ECBehaviorCollider collider
      
-  public func new()+  public func new() super("MultiInstance")
     component = ECBehaviorComponent.new(this)     component = ECBehaviorComponent.new(this)
     collider = ECBehaviorCollider.new(this, component)     collider = ECBehaviorCollider.new(this, component)
Line 142: Line 145:
    public var ECBehaviorOutline outline    public var ECBehaviorOutline outline
        
-   public func new() +   public func new() super("ExampleElement"
-     // add behaviorscomponent, collider and outline+     // add required behaviors component and collider
      component = ECBehaviorComponent.new(this)      component = ECBehaviorComponent.new(this)
      collider = ECBehaviorCollider.new(this, component)      collider = ECBehaviorCollider.new(this, component)
-     outline = ECBehaviorOutline.new(this, component, collider) 
            
-     // set parameters of outline behavior to red color with 0.0075 thickness +     // create outline behavior and set parameters. the outline will be colored red 
-     // using a custom "outline.deskin" skin+     // and has a thickness of 0.0075 using a custom "outline.deskin" skin 
 +     outline = ECBehaviorOutline.new(this, component, collider)
      outline.getSkin().setPath("outline.deskin")      outline.getSkin().setPath("outline.deskin")
      outline.getColor().setColor(Color.red)      outline.getColor().setColor(Color.red)
dragengine/modules/dragonscript/behavior_outline.txt · Last modified: 2024/03/14 16:55 by dragonlord