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 01:05] – [API Documentation] dragonlorddragengine:modules:dragonscript:behavior_outline [2020/05/24 10:35] dragonlord
Line 42: Line 42:
 The emissivity is optional and allows to make the outline glow in the dark. Using renderable "color" is also optional but recommended. This allows this behavior to change the outline color using a dynamic skin. The emissivity is optional and allows to make the outline glow in the dark. Using renderable "color" is also optional but recommended. This allows this behavior to change the outline color using a dynamic skin.
  
-This set up allows to add an outline skin to any ECBehaviorComponent without the need to create skins with built-in support for outline rendering. If you want to use outline for all objects by default better build it into their skins which is faster.+This set up allows to add an outline skin to any [[behavior_component|ECBehaviorComponent]] without the need to create skins with built-in support for outline rendering. If you want to use outline for all objects by default better build it into their skins which is faster.
  
-This behavior can be also used to add outer skins in general to an ECBehaviorComponent. You have to adjust the outline skin to achieve the desired result.+This behavior can be also used to add outer skins in general to an [[behavior_component|ECBehaviorComponent]]. You have to adjust the outline skin to achieve the desired result.
  
 This is an effect type behavior and starts out invisible. Use setVisible() to switch the outline on and off. Typically this is done in response to game events or by other behaviors managing outline parameters. This is an effect type behavior and starts out invisible. Use setVisible() to switch the outline on and off. Typically this is done in response to game events or by other behaviors managing outline parameters.
Line 67: Line 67:
 ====== Element Class Properties ====== ====== Element Class Properties ======
  
-Element class properties have the prefix **outline{(id)}.**.+Element class properties have the prefix **outline.** or **outline(id).** if id is not empty.
  
 ===== skin ===== ===== skin =====
 Path to skin to use to render the outline. Path to skin to use to render the outline.
-  * Full name: "outline{(id)}.skin"+  * Full name: "outline.skin" or "outline(id).skin"
   * Type ECPSkin   * Type ECPSkin
   * Default Value "/shareddata/materials/outlined.deskin"   * Default Value "/shareddata/materials/outlined.deskin"
Line 78: Line 78:
 ===== model ===== ===== model =====
 Path to model to use instead of the model of the dependency component Path to model to use instead of the model of the dependency component
-  * Full name: "outline{(id)}.model"+  * Full name: "outline.model" or "outline(id).model"
   * Type ECPModel   * Type ECPModel
   * Default value //null//   * Default value //null//
Line 85: Line 85:
 ===== rig ===== ===== rig =====
 Path to rig to use instead of the rig of the dependency component. If null uses the dependency component rig. Path to rig to use instead of the rig of the dependency component. If null uses the dependency component rig.
-  * Full name: "outline{(id)}.rig"+  * Full name: "outline.rig" or "outline(id).rig"
   * Type ECPRig   * Type ECPRig
   * Default value //null//   * Default value //null//
Line 92: Line 92:
 ===== color ===== ===== color =====
 Color of the outline. For this property to have any effect the used skin requires to have a renderable named "color". Color of the outline. For this property to have any effect the used skin requires to have a renderable named "color".
-  * Full name: "outline{(id)}.color"+  * Full name: "outline.color" or "outline(id).color"
   * Type ECPColor   * Type ECPColor
-  * Default value //white (111)//+  * Default value //black (000)//
   * Example (*.deeclass) <code xml><color name='outline.color' r='1' g='0' b='0'/></code>   * Example (*.deeclass) <code xml><color name='outline.color' r='1' g='0' b='0'/></code>
  
 ===== intensity ===== ===== intensity =====
 Emissivity intensity of the outline. For this property to have any effect the used skin requires to have a renderable named "intensity". Emissivity intensity of the outline. For this property to have any effect the used skin requires to have a renderable named "intensity".
-  * Full name: "outline{(id)}.intensity"+  * Full name: "outline.intensity" or "outline(id).intensity"
   * Type ECPFloat   * Type ECPFloat
   * Minimum Value 0   * Minimum Value 0
Line 107: Line 107:
 ===== thickness ===== ===== thickness =====
 Thickness of the outline. The measurement unit of this value depends on the outline type in the used skin. For this property to have any effect the used skin requires to have a renderable named "thickness". Thickness of the outline. The measurement unit of this value depends on the outline type in the used skin. For this property to have any effect the used skin requires to have a renderable named "thickness".
-  * Full name: "outline{(id)}.thickness"+  * Full name: "outline.thickness" or "outline(id).thickness"
   * Type ECPFloat   * Type ECPFloat
   * Minimum Value 0   * Minimum Value 0
Line 131: Line 131:
 Since DragonScript Module Version **1.1** Since DragonScript Module Version **1.1**
  
 +====== Use Cases ======
 +  * Highlight objects player can interact with. Combine this with [[behavior_lookedat|ECBehaviorLookedAt]] using a listening to show/hide the highlight if the player looks at the object.
 +  * Use for Toon-Rendering to draw a black outline on all objects.
 +====== Element Class Example ======
 +
 +<code>
 +class ExampleElementClass extends BehaviorElementClass
 +   public var ECBehaviorComponent component
 +   public var ECBehaviorCollider collider
 +   public var ECBehaviorOutline outline
 +   
 +   public func new()
 +     // add behaviors: component, collider and outline
 +     component = ECBehaviorComponent.new(this)
 +     collider = ECBehaviorCollider.new(this, component)
 +     outline = ECBehaviorOutline.new(this, component, collider)
 +     
 +     // set parameters of outline behavior to red color with 0.0075 thickness
 +     // using a custom "outline.deskin" skin
 +     outline.getSkin().setPath("outline.deskin")
 +     outline.getColor().setColor(Color.red)
 +     outline.getThickness().setValue(0.0075)
 +   end
 +end
 +</code>
dragengine/modules/dragonscript/behavior_outline.txt · Last modified: 2024/03/14 16:55 by dragonlord