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);
}
}
}
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;
}
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;
}
Aggregations