Android Open Source - makipong Pala User Input






From Project

Back to project page makipong.

License

The source code is released under:

GNU General Public License

If you think the Android project makipong listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package tk.makigas.makipong;
// ww w.j  a  v  a2  s .c  o m
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;

public class PalaUserInput extends InputListener {

  private PalaActor pala;
  
  private float delta;
  
  public PalaUserInput(PalaActor pala) {
    this.pala = pala;
  }
  
  @Override
  public boolean touchDown(InputEvent event, float x, float y, int pointer,
      int button) {
    delta = event.getStageY();
    return true;
  }
  
  @Override
  public void touchDragged(InputEvent event, float x, float y, int pointer) {
    pala.translate(0, event.getStageY() - delta);
    delta = event.getStageY();
  }
  
}




Java Source Code List

tk.makigas.makipong.BolaActor.java
tk.makigas.makipong.MainActivity.java
tk.makigas.makipong.Main.java
tk.makigas.makipong.Makipong.java
tk.makigas.makipong.PalaActor.java
tk.makigas.makipong.PalaUserInput.java