Ejemplo n.º 1
0
 public void update(float t) {
   if (t == 1f) {
     super._isEnd = true;
     super._target.setPosition(this._delta.x + this._orgPos.x, this._delta.y + this._orgPos.y);
   } else {
     float num = this._height * MathUtils.abs(MathUtils.sin(((t * 3.141593f) * this._jumps)));
     num += this._delta.y * t;
     float num2 = this._delta.x * t;
     super._target.setPosition(num2 + this._orgPos.x, num + this._orgPos.y);
   }
 }
Ejemplo n.º 2
0
 public static LNRepeat Action(LNAction action, int t) {
   LNRepeat repeat = new LNRepeat();
   repeat.time = t;
   repeat._action = action;
   repeat._duration = t * action.getDuration();
   return repeat;
 }
Ejemplo n.º 3
0
 public void initButtonWithFadeoutTwinkle(String fsName1, float Opacity) {
   LNSprite sprite = new LNSprite(fsName1);
   this._buttonElement.put("Image", sprite);
   super.addNode(sprite, 0);
   super.setNodeSize(sprite.getWidth(), sprite.getHeight());
   super.setAnchor(new Vector2f(super.getWidth() / 2f, super.getWidth() / 2f));
   LNAction action = LNSequence.Action(new LNAction[] {LNAlphaAction.Action(Opacity)});
   action.assignTarget(sprite);
   LNAction action2 = LNSequence.Action(new LNAction[] {LNAlphaAction.Action(1f)});
   action2.assignTarget(sprite);
   LNSequence sequence =
       LNSequence.Action(
           new LNAction[] {
             LNAlphaAction.Action(1f), LNDelay.Action(0.1f),
             LNAlphaAction.Action(0.5f), LNDelay.Action(0.1f)
           });
   LNAction action3 =
       LNSequence.Action(
           new LNAction[] {
             LNRepeat.Action(sequence, 3), LNShow.Action(), LNAlphaAction.Action(1f)
           });
   action3.assignTarget(sprite);
   this._touchBeganAction.put("Image", action);
   this._touchMoveOutAction.put("Image", action2);
   this._touchClickedAction.put("Image", action3);
 }
Ejemplo n.º 4
0
 public void initButtonWithTextureTwinkle(String fsName1, String fsName2) {
   this.fs = LNDataCache.getFrameStruct(fsName1);
   LNAnimation anim = new LNAnimation("Frame", 0.1f, fsName1, fsName2);
   LNSprite sprite = new LNSprite();
   sprite.addAnimation(anim);
   sprite.setFrame("Frame", 0);
   this._buttonElement.put("Image", sprite);
   super.addNode(sprite, 0);
   super.setNodeSize(sprite.getWidth(), sprite.getHeight());
   super.setAnchor(new Vector2f(super.getWidth() / 2f, super.getHeight() / 2f));
   LNAction action = LNSequence.Action(LNFrameAction.Action("Frame", 1));
   action.assignTarget(sprite);
   LNAction action2 = LNSequence.Action(LNFrameAction.Action("Frame", 0));
   action2.assignTarget(sprite);
   LNAction action3 =
       LNSequence.Action(
           LNRepeat.Action(LNAnimate.Action(anim), 1), LNFrameAction.Action("Frame", 0));
   action3.assignTarget(sprite);
   this._touchBeganAction.put("Image", action);
   this._touchMoveOutAction.put("Image", action2);
   this._touchClickedAction.put("Image", action3);
 }
Ejemplo n.º 5
0
 public void initCheckboxWithPrssingTexture(
     String fsName1, String fsName2, String fsName3, String fsName4) {
   if ((fsName3.equals("")) && (fsName4.equals(""))) {
     LNSprite node = new LNSprite(fsName1);
     LNSprite sprite2 = new LNSprite(fsName2);
     sprite2.setVisible(false);
     super.addNode(node, 0);
     super.addNode(sprite2, 0);
     this._buttonElement.put("ImageOn", node);
     this._buttonElement.put("ImageOff", sprite2);
     super.setNodeSize(node.getWidth(), node.getHeight());
     super.setAnchor(new Vector2f(super.getWidth() / 2f, super.getHeight() / 2f));
     LNAction action = LNSequence.Action(LNToggleVisibility.Action());
     action.assignTarget(node);
     this._touchClickedAction.put("ImageOn", action);
     LNAction action2 = LNSequence.Action(LNToggleVisibility.Action());
     action2.assignTarget(sprite2);
     this._touchClickedAction.put("ImageOff", action2);
   } else {
     LNAnimation anim = new LNAnimation("Frame", 0.1f, new String[] {fsName1, fsName3});
     LNAnimation animation2 = new LNAnimation("Frame", 0.1f, new String[] {fsName2, fsName4});
     LNSprite sprite3 = new LNSprite();
     LNSprite sprite4 = new LNSprite();
     sprite3.addAnimation(anim);
     sprite4.addAnimation(animation2);
     sprite3.setFrame("Frame", 0);
     sprite4.setFrame("Frame", 0);
     super.addNode(sprite3, 0);
     super.addNode(sprite4, 0);
     sprite4.setVisible(false);
     this._buttonElement.put("ImageOn", sprite3);
     this._buttonElement.put("ImageOff", sprite4);
     super.setNodeSize(sprite3.getWidth(), sprite3.getHeight());
     super.setAnchor(new Vector2f(super.getWidth() / 2f, super.getHeight() / 2f));
     LNAction action3 = LNSequence.Action(LNFrameAction.Action("Frame", 1));
     action3.assignTarget(sprite3);
     LNAction action4 = LNSequence.Action(LNFrameAction.Action("Frame", 0));
     action4.assignTarget(sprite3);
     LNAction action5 =
         LNSequence.Action(LNToggleVisibility.Action(), LNFrameAction.Action("Frame", 0));
     action5.assignTarget(sprite3);
     this._touchBeganAction.put("ImageOn", action3);
     this._touchMoveOutAction.put("ImageOn", action4);
     this._touchClickedAction.put("ImageOn", action5);
     LNAction action6 = LNSequence.Action(LNFrameAction.Action("Frame", 1));
     action6.assignTarget(sprite4);
     LNAction action7 = LNSequence.Action(LNFrameAction.Action("Frame", 0));
     action7.assignTarget(sprite4);
     LNAction action8 =
         LNSequence.Action(LNToggleVisibility.Action(), LNFrameAction.Action("Frame", 0));
     action8.assignTarget(sprite4);
     this._touchBeganAction.put("ImageOff", action6);
     this._touchMoveOutAction.put("ImageOff", action7);
     this._touchClickedAction.put("ImageOff", action8);
   }
 }
Ejemplo n.º 6
0
 @Override
 public void step(float dt) {
   super._target.setPosition(this._pos);
   super._isEnd = true;
 }