Configurable Emitters

From Slick2D Wiki
Jump to: navigation, search

ConfigurableEmitters are a generic type of Emitter that is configured by an open XML specification. These emitters can be visually designed with the Pedigree Editor and can be loaded into Slick using the ConfigurableEmitters.

The configurable emitter description allows definition of how particles will be produced (their size, colour, location etc) and how they will change with time. An extension to the specification (and the Editor) produced by Void allows these changes to specified with multiple point interpolation - allowing wierd and wonderful changes during the lifetime of the particles.

Examples[edit]

Flame.xml[edit]

Description: A burning flame.

<emitter imageName="" name="Flame">
<spawnInterval enabled="false" max="100.0" min="100.0"/>
<spawnCount enabled="true" max="20.0" min="5.0"/>
<initialLife enabled="false" max="1000.0" min="1000.0"/>
<initialSize enabled="true" max="25.0" min="25.0"/>
<xOffset enabled="true" max="8.0" min="-8.0"/>
<yOffset enabled="true" max="15.0" min="-8.0"/>
<initialDistance enabled="false" max="0.0" min="0.0"/>
<speed enabled="true" max="200.0" min="50.0"/>
<length enabled="false" max="1000.0" min="1000.0"/>
<spread value="26.0"/>
<angularOffset value="0.0"/>
<growthFactor value="50.0"/>
<gravityFactor value="0.0"/>
<startAlpha value="255.0"/>
<endAlpha value="0.0"/>
<color>
<step b="1.0" g="1.0" offset="0.0" r="1.0"/>
<step b="0.0" g="1.0" offset="0.336" r="1.0"/>
<step b="0.0" g="0.0" offset="1.0" r="1.0"/>
</color>
</emitter>

Smoke[edit]

Description: Smoke emitting from a centerpoint

<emitter imageName="" name="Smoke">
<spawnInterval enabled="false" max="100.0" min="100.0"/>
<spawnCount enabled="true" max="1.0" min="1.0"/>
<initialLife enabled="true" max="4000.0" min="4000.0"/>
<initialSize enabled="true" max="28.0" min="28.0"/>
<xOffset enabled="false" max="0.0" min="0.0"/>
<yOffset enabled="true" max="0.0" min="0.0"/>
<initialDistance enabled="false" max="0.0" min="0.0"/>
<speed enabled="true" max="70.0" min="50.0"/>
<length enabled="false" max="1000.0" min="1000.0"/>
<spread value="30.0"/>
<angularOffset value="0.0"/>
<growthFactor value="9.0"/>
<gravityFactor value="0.0"/>
<startAlpha value="255.0"/>
<endAlpha value="0.0"/>
<color>
<step b="1.0" g="0.8" offset="0.0" r="0.8"/>
<step b="0.4" g="0.4" offset="1.0" r="0.4"/>
</color>
</emitter>