Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a17d85
commit 29c0074
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package core.ui.deck; | ||
|
||
import com.jme3.scene.Spatial; | ||
import com.simsilica.lemur.event.CursorButtonEvent; | ||
import com.simsilica.lemur.event.CursorListener; | ||
import com.simsilica.lemur.event.CursorMotionEvent; | ||
|
||
/** | ||
* @author doc | ||
*/ | ||
public class CardHoverListener implements CursorListener { | ||
private DeckElement deckElement; | ||
private boolean isHovered = false; | ||
|
||
public CardHoverListener(DeckElement deckElement) { | ||
this.deckElement = deckElement; | ||
} | ||
|
||
@Override | ||
public void cursorButtonEvent(CursorButtonEvent cursorButtonEvent, Spatial target, Spatial capture) { | ||
} | ||
|
||
@Override | ||
public void cursorEntered(CursorMotionEvent cursorMotionEvent, Spatial target, Spatial capture) { | ||
cursorMotionEvent.setConsumed(); | ||
|
||
isHovered = true; | ||
} | ||
|
||
@Override | ||
public void cursorExited(CursorMotionEvent cursorMotionEvent, Spatial target, Spatial capture) { | ||
cursorMotionEvent.setConsumed(); | ||
|
||
isHovered = false; | ||
} | ||
|
||
@Override | ||
public void cursorMoved(CursorMotionEvent cursorMotionEvent, Spatial target, Spatial capture) { | ||
|
||
} | ||
|
||
public boolean isHovered() { | ||
return isHovered; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters