public class ShortLifeNode extends Node
| Modifier and Type | Class and Description |
|---|---|
static class |
ShortLifeNode.Mode
This hints the ShortLifeNode how to behave,
once the lifespan ends.
|
| Modifier and Type | Field and Description |
|---|---|
protected Callback<ShortLifeNode> |
deathCallback
This callback gets called, when the life has end of this Node.
|
protected float |
lifeTime
The amount of time the Node has "lived" in the scenegraph
in seconds
|
protected float |
maxLifeTime
The max lifetime this Node has,
This value should be in seconds!
|
protected ShortLifeNode.Mode |
mode
The Mode hint
|
| Constructor and Description |
|---|
ShortLifeNode(float maxLifeTime)
Construct a ShortLifeNode with just a maximum life time.
|
ShortLifeNode(float maxLifeTime,
ShortLifeNode.Mode mode,
Callback<ShortLifeNode> callback)
Construct a ShortLifeNode.
|
ShortLifeNode(String name,
float maxLifeTime)
Construct a ShortLifeNode with a name and max. life time.
|
ShortLifeNode(String name,
float maxLifeTime,
ShortLifeNode.Mode mode,
Callback<ShortLifeNode> callback)
Construct a ShortLifeNode.
|
| Modifier and Type | Method and Description |
|---|---|
Callback<ShortLifeNode> |
getDeathCallback()
This callback gets called, when the life has end of this Node.
|
void |
setDeathCallback(Callback<ShortLifeNode> deathCallback)
This callback gets called, when the life has end of this Node.
|
void |
update(float delta)
Trigger an update.
|
add, add, add, addToWorld, getChildren, getEngine, getEntities, getEntity, getName, getParent, getTransform, numberOfEntities, remove, remove, remove, remove, removed, render, setChildren, setEngine, setEntities, setName, setParent, setTransform, toStringprotected final float maxLifeTime
lifeTime is greater than maxLifeTime
it gets removed.protected float lifeTime
protected ShortLifeNode.Mode mode
protected Callback<ShortLifeNode> deathCallback
Node.removed().public ShortLifeNode(String name, float maxLifeTime, ShortLifeNode.Mode mode, Callback<ShortLifeNode> callback)
name - The Name of the NodemaxLifeTime - The maximum lifetime in secondsmode - The ShortLifeNode.Mode hintcallback - Death callback deathCallbackpublic ShortLifeNode(float maxLifeTime,
ShortLifeNode.Mode mode,
Callback<ShortLifeNode> callback)
maxLifeTime - The maximum lifetime in secondsmode - The ShortLifeNode.Mode hintcallback - Death callback deathCallbackpublic ShortLifeNode(String name, float maxLifeTime)
ShortLifeNode.Mode.DETACHname - The Name of the NodemaxLifeTime - The maximum lifetime in secondspublic ShortLifeNode(float maxLifeTime)
ShortLifeNode.Mode.DETACHmaxLifeTime - The maximum lifetime in secondspublic void update(float delta)
@Generated(value="lombok") public Callback<ShortLifeNode> getDeathCallback()
Node.removed().@Generated(value="lombok") public void setDeathCallback(Callback<ShortLifeNode> deathCallback)
Node.removed().deathCallback - new deathCallbackCopyright © 2015. All rights reserved.