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 AnimatedEntitygetAnimatedEntity()Set<String>getAnimations()voidonRender()In this method the GameObject gets rendered onto the screen (if it has an graphical representation).voidonUpdate()This method gets called every frame before the render method.voidpause()Pause the animationvoidplay()Play / resume the animationvoidsetAnimatedEntity(AnimatedEntity animatedEntity)Setting the entity, that should be animated.booleansetAnimation(String animation)Setting the animation, that should be played.voidsetAnimationSpeed(float animationSpeed)Setting the speed of the animation.voidsetCurrentTime(float currentTime)Setting the current time of the animationvoidsetLoop(boolean loop)Should the animation loop, when its overvoidstop()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:GameObjectThis method gets called every frame before the render method. Here is place for the GameObject logic updates, e.g. input handling, physics, actions, ...- Overrides:
onUpdatein 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:GameObjectIn this method the GameObject gets rendered onto the screen (if it has an graphical representation). Its primary used for MasterRenderer calls.- Overrides:
onRenderin 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
-
-