Examples of AnimationComponent


Examples of com.sertaogames.cactus2d.components.AnimationComponent

    sr = new SpriteRendererComponent(null,matriz3[2][0]);
    seismographGO.AddComponent(sr);
    addGameObject(seismographGO);
   
    GameObject animatedGO = new GameObject("anim");
    AnimationComponent anim = new AnimationComponent();
    Texture tx  = new Texture(Gdx.files.internal("data/textures/sismoAnim.png"));
    int[] frames = { 0, 1, 2, 3, 4, 5, 6, 7};
    anim.addAnimation("anim", tx, 384, 192, frames, 5, false);
   
    anim.play("anim");
   
    animatedGO.AddComponent(anim);
    animatedGO.AddComponent(new SpriteRendererComponent(null));
    animatedGO.transform.getPosition().add(width/2 - 370/2, height/2 - 215/2);
    seismographGO.addGameObject(animatedGO);
View Full Code Here

Examples of org.spout.api.component.entity.AnimationComponent

    ModelComponent models = entity.get(ModelComponent.class);
    if (models == null) {
      return;
    }

    AnimationComponent animations = entity.get(AnimationComponent.class);
    if (animations == null) {
      return;
    }

    //This code launch the first animation finded on the first model
    //TODO : play with animation API

    switch (message.getAnimation()) {
      case SWING_ARM:
        Model model = models.getModels().get(0);//get first model

        if (model == null) {
          return;
        }

        if (model.getAnimations() == null || model.getAnimations().isEmpty()) {
          return;
        }

        Animation animation = model.getAnimations().values().iterator().next();

        animations.playAnimation(model, animation);

        break;
      default:
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.