And*_*rew 5 java libgdx onclicklistener
在libgdx中是否有任何监听器允许我检测只是悬停时没有按下的鼠标悬停.在场景2D的按钮类中,你有两个方法是isOver和isPressed但它们做同样的事情......其他人有这个问题吗?有没有其他方法来检测鼠标悬停在演员身上?
有ClickListener一个可以附加到它Actor,它提供如下事件:
public void enter(InputEvent event, float x, float y, int pointer, Actor fromActor)
public void exit(InputEvent event, float x, float y, int pointer, Actor toActor)
Run Code Online (Sandbox Code Playgroud)
该enter事件basiscally意味着鼠标开始盘旋在演员,exit意味着它"左"的男主角的区域.它还有一个clicked事件,您可以使用它最终执行某些操作.
| 归档时间: |
|
| 查看次数: |
4950 次 |
| 最近记录: |