Package de.coreengine.system.gameObjects
Class Animated
- java.lang.Object
-
- de.coreengine.system.GameObject
-
- de.coreengine.system.gameObjects.Animated
-
public class Animated extends GameObject
-
-
Field Summary
-
Fields inherited from class de.coreengine.system.GameObject
parent
-
-
Constructor Summary
Constructors Constructor Description Animated()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnimatedEntity
getAnimatedEntity()
Set<String>
getAnimations()
void
onRender()
In this method the GameObject gets rendered onto the screen (if it has an graphical representation).void
onUpdate()
This method gets called every frame before the render method.void
pause()
Pause the animationvoid
play()
Play / resume the animationvoid
setAnimatedEntity(AnimatedEntity animatedEntity)
Setting the entity, that should be animated.boolean
setAnimation(String animation)
Setting the animation, that should be played.void
setAnimationSpeed(float animationSpeed)
Setting the speed of the animation.void
setCurrentTime(float currentTime)
Setting the current time of the animationvoid
setLoop(boolean loop)
Should the animation loop, when its overvoid
stop()
Stop the animation and jump to beginning-
Methods inherited from class de.coreengine.system.GameObject
addActionToPhysicWorld, addChild, addRigidBodyToWorld, getScene, onAdd, onInit, onLoad, onPauseUpdate, onRemove, onSave, onSyncronize, removeChild, setShouldRender, setShouldSyncronize, setShouldUpdate
-
-
-
-
Method Detail
-
play
public void play()
Play / resume the animation
-
stop
public void stop()
Stop the animation and jump to beginning
-
pause
public void pause()
Pause the animation
-
onUpdate
public void onUpdate()
Description copied from class:GameObject
This method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...- Overrides:
onUpdate
in classGameObject
-
setAnimationSpeed
public void setAnimationSpeed(float animationSpeed)
Setting the speed of the animation. (curFrame += frameTime * animationSpeed)- Parameters:
animationSpeed
- New animation speed
-
onRender
public void onRender()
Description copied from class:GameObject
In this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.- Overrides:
onRender
in classGameObject
-
setLoop
public void setLoop(boolean loop)
Should the animation loop, when its over- Parameters:
loop
- Should the animation loop, when its over
-
setCurrentTime
public void setCurrentTime(float currentTime)
Setting the current time of the animation- Parameters:
currentTime
- Current time of the animation
-
setAnimatedEntity
public void setAnimatedEntity(AnimatedEntity animatedEntity)
Setting the entity, that should be animated. Unset the current set animation.- Parameters:
animatedEntity
- Entity to animate
-
setAnimation
public boolean setAnimation(String animation)
Setting the animation, that should be played. If the animation doesnt exist or the anmated entity isnt set, animation will not be setted and this method returns false. Pass null to unset animation- Parameters:
animation
- Animation to play- Returns:
- Animation not setted (Animation dont exist or animated entitiy isnt set)
-
getAnimatedEntity
public AnimatedEntity getAnimatedEntity()
- Returns:
- Current set entity
-
-