Back to project page ssniper-andengine.
The source code is released under:
Apache License
If you think the Android project ssniper-andengine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.cladophora.ssniper; // w ww.j a v a2 s .c o m import android.view.MotionEvent; import android.view.View; import com.cladophora.ssniper.entity.Reticle; import com.cladophora.ssniper.scene.GameScene; /** * Created by jmar on 12/28/13. */ public class HoverListener implements com.samsung.spensdk.applistener.SPenHoverListener { static HoverListener instance; public static HoverListener getSharedInstance() { if (instance == null) instance = new HoverListener(); return instance; } @Override public boolean onHover(final View view, final MotionEvent motionEvent) { switch (motionEvent.getAction()) { case MotionEvent.ACTION_HOVER_MOVE: // Pass hover coordinates to aim method Reticle.getSharedInstance().aim(motionEvent.getX(),motionEvent.getY()); return true; case MotionEvent.ACTION_HOVER_ENTER: // Pass hover coordinates to aim method Reticle.getSharedInstance().aim(motionEvent.getX(),motionEvent.getY()); return true; default: return false; } } @Override public void onHoverButtonDown(View view, MotionEvent motionEvent) { if (GameScene.inGame && !GameScene.slowTimeActive && GameScene.slowTimeBank > (GameScene.SLOW_TIME_BANK_MAX * 0.5f)) { GameScene.activateSlowTime(); } } @Override public void onHoverButtonUp(View view, MotionEvent motionEvent) { //GameScene.slowTimeActive = true; } }