Search in sources :

Example 1 with Animations

use of ilargia.egdx.logicbricks.component.game.Animations in project Entitas-Java by Rubentxu.

the class AnimationSystem method execute.

@Override
public void execute(float deltaTime) {
    for (GameEntity e : _groupAnimation.getEntities()) {
        Animations animations = e.getAnimations();
        TextureView view = e.getTextureView();
        animations.time += deltaTime;
        Animation<TextureRegion> animation = animations.currentAnimation;
        if (animation != null) {
            view.texture = animation.getKeyFrame(animations.time);
        }
    }
}
Also used : GameEntity(ilargia.egdx.logicbricks.gen.game.GameEntity) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) Animations(ilargia.egdx.logicbricks.component.game.Animations) TextureView(ilargia.egdx.logicbricks.component.game.TextureView)

Example 2 with Animations

use of ilargia.egdx.logicbricks.component.game.Animations in project Entitas-Java by Rubentxu.

the class GameEntity method addAnimations.

public GameEntity addAnimations(Map<String, Animation<TextureRegion>> animationStates, Animation<TextureRegion> currentAnimation, float time) {
    Animations component = (Animations) recoverComponent(GameComponentsLookup.Animations);
    if (component == null) {
        component = new Animations();
    }
    component.animationStates = animationStates;
    component.currentAnimation = currentAnimation;
    component.time = time;
    addComponent(GameComponentsLookup.Animations, component);
    return this;
}
Also used : Animations(ilargia.egdx.logicbricks.component.game.Animations)

Example 3 with Animations

use of ilargia.egdx.logicbricks.component.game.Animations in project Entitas-Java by Rubentxu.

the class GameEntity method replaceAnimations.

public GameEntity replaceAnimations(Map<String, Animation<TextureRegion>> animationStates, Animation<TextureRegion> currentAnimation, float time) {
    Animations component = (Animations) recoverComponent(GameComponentsLookup.Animations);
    if (component == null) {
        component = new Animations();
    }
    component.animationStates = animationStates;
    component.currentAnimation = currentAnimation;
    component.time = time;
    replaceComponent(GameComponentsLookup.Animations, component);
    return this;
}
Also used : Animations(ilargia.egdx.logicbricks.component.game.Animations)

Aggregations

Animations (ilargia.egdx.logicbricks.component.game.Animations)3 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 TextureView (ilargia.egdx.logicbricks.component.game.TextureView)1 GameEntity (ilargia.egdx.logicbricks.gen.game.GameEntity)1