Bandidos
|
Public Member Functions | |
AnimationComponent (Animations animations, boolean playOnCreation, boolean isUI) | |
float | getAnimationSpeed () |
void | setAnimationSpeed (float animationSpeed) |
String | getCurrentAnimation () |
void | setCurrentAnimation (String animationName, boolean playOnSet, boolean canBeSameAnimation) |
void | setCurrentAnimation (String animationName, boolean playOnSet) |
int | getCurrentFrame () |
int | getAnimationLength () |
float | getNormalizedTime () |
boolean | isPlaying () |
void | pause () |
void | unpause () |
boolean | isPaused () |
void | play () |
void | stop () |
void | stopAndReset () |
void | reset () |
void | awake () |
void | update (float deltaTime) |
Public Member Functions inherited from com.mygdx.game.engine.entities.components.rendering.RenderComponent | |
RenderComponent (RenderInfo startRenderInfo, boolean isUI) | |
boolean | isUserInterface () |
boolean | isSortedOnY () |
int | getCurrentFrameInfo () |
void | setCurrentFrameInfo (int index) |
void | setSortOnY (boolean sortOnY) |
double | getInnerSortingLayer () |
int | getSortingLayer () |
void | setSortingLayer (int sortingLayer) |
float | getRealWidth () |
float | getRealHeight () |
float | getPivotX () |
float | getPivotY () |
void | setPivot (float pivotX, float pivotY, boolean keepPosition) |
RenderInfo | getRenderInfo () |
boolean | getCallsRenderAfterEntityRender () |
void | setCallsRenderAfterEntityRender (boolean renderAfterEntityRender) |
void | setAlpha (float alpha) |
float | getAlpha () |
EngineTween | doAlpha (float value, float duration, TweenStartType tweenStartType) |
EngineTween | doColor (Color color, float duration, TweenStartType tweenStartType) |
void | setColor (Color color) |
void | setColor (float r, float g, float b, float a) |
Color | getColor () |
void | setRenderInfo (RenderInfo info) |
Texture | getCurrentTexture () |
void | setCurrentTexture (Texture texture) |
boolean | getFlipX () |
boolean | getFlipY () |
void | setFlipX (boolean flipX) |
void | setFlipY (boolean flipY) |
int | compare (RenderComponent d, RenderComponent d1) |
int | compareTo (RenderComponent comp) |
void | awake () |
Public Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent | |
EngineTween | startTweenOnComponent (Tween tween, TweenStartType tweenStartType) |
Timeline | startTimelineOnComponent (Timeline timeline, boolean updateInGameTime) |
EngineTween | doFloat (TweenableFloat floatToTween, float newValue, float duration, TweenStartType tweenStartType) |
void | stopAllComponentTweens () |
void | initialize (BaseEntity parentEntity) |
BaseEntity | getParentOfComponent () |
boolean | isActive () |
boolean | isDestroyed () |
void | setActiveState (boolean activeState) |
void | destroy () |
void | update (float deltaTime) |
abstract void | awake () |
Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher | |
void | addEventListener (String type, IEventReceiver listeningClass) |
void | dispatchEvent (Event event) |
void | removeEventListener (String type, IEventReceiver listener) |
boolean | hasEventListener (String type) |
ArrayList< ListenerItem > | getAllListeners () |
void | destroyAllListeners () |
void | clean () |
Static Public Attributes | |
static final String | EVENT_ANIMATION_STARTED = "AnimationStartedEvent" |
static final String | EVENT_ANIMATION_LOOPED = "AnimationLoopedEvent" |
static final String | EVENT_ANIMATION_STOPPED = "AnimationStoppedEvent" |
Protected Member Functions | |
void | destroyed () |
void | activeStateChanged () |
Protected Member Functions inherited from com.mygdx.game.engine.entities.components.rendering.RenderComponent | |
void | updated (float deltaTime) |
void | destroyed () |
void | activeStateChanged () |
Protected Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent | |
abstract void | updated (float deltaTime) |
abstract void | destroyed () |
abstract void | activeStateChanged () |
This component is an extension on the RenderComponent and allows for animations to be played. Note: When this component is on an entity, no RenderComponent is needed.
com.mygdx.game.engine.entities.components.rendering.AnimationComponent.AnimationComponent | ( | Animations | animations, |
boolean | playOnCreation, | ||
boolean | isUI | ||
) |
|
protected |
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.awake | ( | ) |
|
protected |
int com.mygdx.game.engine.entities.components.rendering.AnimationComponent.getAnimationLength | ( | ) |
Gets the length of the currently set animation
float com.mygdx.game.engine.entities.components.rendering.AnimationComponent.getAnimationSpeed | ( | ) |
Returns the animation speed in comparison to the frame rate (DEFAULT: 0.5 (30 fps on 60 fps game))
String com.mygdx.game.engine.entities.components.rendering.AnimationComponent.getCurrentAnimation | ( | ) |
Returns the name of the current animation
int com.mygdx.game.engine.entities.components.rendering.AnimationComponent.getCurrentFrame | ( | ) |
Gets the current animation frame.
float com.mygdx.game.engine.entities.components.rendering.AnimationComponent.getNormalizedTime | ( | ) |
Gets the normalized time of the animation. (Current Frame is 5 and total frames is 10 then it returns 0.5)
boolean com.mygdx.game.engine.entities.components.rendering.AnimationComponent.isPaused | ( | ) |
Returns whether the animation is paused or not.
boolean com.mygdx.game.engine.entities.components.rendering.AnimationComponent.isPlaying | ( | ) |
Returns whether the animation is running and not paused.
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.pause | ( | ) |
Pauses the current animation
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.play | ( | ) |
Starts the animation from the start.
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.reset | ( | ) |
Resets the current animation to the first frame.
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.setAnimationSpeed | ( | float | animationSpeed | ) |
Sets the animation speed in comparison to the frame rate (DEFAULT: 0.5 (30 fps on 60 fps game))
animationSpeed | normalized value to set the new animation speed on |
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.setCurrentAnimation | ( | String | animationName, |
boolean | playOnSet, | ||
boolean | canBeSameAnimation | ||
) |
Sets the current animation to the animation with the given name. The animations are defined in the Animations class given in the constructor.
animationName | of the animation which should be set as current animation |
playOnSet | if 'true', the animation will play after it is set, else it will not |
canBeSameAnimation | indicates whether the animation can be the same. If not and the animation given is already the current animation, this method will not be executed, else it will always. |
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.setCurrentAnimation | ( | String | animationName, |
boolean | playOnSet | ||
) |
Sets the current animation to the animation with the given name. The animations are defined in the Animations class given in the constructor. This wont play the animation if its already playing
animationName | of the animation which should be set as current animation |
playOnSet | if 'true', the animation will play after it is set, else it will not |
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.stop | ( | ) |
Stops the animation at the current frame. Can only be undone with the 'play' method
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.stopAndReset | ( | ) |
Stops and resets the animation. Can only be undone with the 'play' method
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.unpause | ( | ) |
UnPauses the current animation
void com.mygdx.game.engine.entities.components.rendering.AnimationComponent.update | ( | float | deltaTime | ) |
|
static |
|
static |
|
static |