@Override
  public void create() {
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);

    MyActor myActor = new MyActor();

    MoveToAction action = Actions.action(MoveToAction.class);
    action.setPosition(100, 0);
    action.setDuration(2f);
    action.setInterpolation(Interpolation.linear);
    myActor.addAction(action);
    stage.addActor(myActor);
  }
  public static RemoveListenerAction create(ActionContext actionContext) {
    Thing self = (Thing) actionContext.get("self");

    RemoveListenerAction ac = Actions.action(RemoveListenerAction.class);

    if (self.getStringBlankAsNull("capture") != null) {
      ac.setCapture(self.getBoolean("capture"));
    }

    EventListener listener = (EventListener) actionContext.get("listener");
    ac.setListener(listener);

    Actor actor = (Actor) actionContext.get("actor");
    ac.setActor(actor);

    actionContext.getScope(0).put(self.getMetadata().getName(), ac);

    return ac;
  }
Ejemplo n.º 3
0
  public static ColorAction create(ActionContext actionContext) throws OgnlException {
    Thing self = (Thing) actionContext.get("self");

    ColorAction action = Actions.action(ColorAction.class);
    Color startColor = (Color) self.getObject("startColor", actionContext);
    if (startColor != null) {
      action.setColor(startColor);
    }

    Color endColor = (Color) self.getObject("endColor", actionContext);
    if (endColor != null) {
      action.setEndColor(endColor);
    }

    TemporalActionActions.init(self, action, actionContext);

    actionContext.getScope(0).put(self.getMetadata().getName(), action);

    return action;
  }