Table of Contents

,

Start Page » DragonScript Scripting Language » Abstraction Layers: How you want to build your Game » Behavior Elements » ECBehaviorStashable

ECBehaviorStashable

Behavior element behavior adding support for elements to be placed in ECBehaviorInventory.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have the prefix stashable. .

image

Set image to display in inventory screens.

video

Set video to display in inventory screens.

name

Set name to display in inventory screens.

description

Set description to display in inventory screens.

Events

addedToInventory

Stashable has been added to inventory.

removedFromInventory

Stashable has been remove from inventory.

Required Behaviors

This behavior requires no other behaviors.

Optional Behaviors

This behavior does not support optional behaviors.

Persistency

This behavior does not required element class to be persistable (setPersistable).

API Documentation

ECBehaviorStashable.

Since DragonScript Module Version 1.0

Use Cases

Element Class Example

This example defines an element which contains a resources.

class MyElement extends BehaviorElementClass
  public var ECBehaviorStashable stashable
  func new()
    stashable = ECBehaviorStashable.new(this)
  end
end

Behavior Factory

Using element class supporting adding behaviors the behavior can be added like this:

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='MyClass' class='GenericBehaviorElement'>
  <behavior type='ECBehaviorStashable'>
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.name'>Cool Tool</string>
  </behavior>
</elementClass>

Live Examples