Java - LibGDX - What is the difference between isKeyPressed and isKeyJustPressed?

廉价感情. 提交于 2019-12-06 01:34:15

问题


What is the difference between isKeyPressed and isKeyJustPressed?!

I searched the docs. for the difference and just found:

isKeyPressed: Returns whether the key is pressed.

isKeyJustPressed: Returns whether the key has just been pressed.

Anybody knows something that explains better?!


回答1:


isKeyPressed detects whether the key is currently pressed.

isKeyJustPressed detects whether the key was pressed and released the last frame.



来源:https://stackoverflow.com/questions/40979622/java-libgdx-what-is-the-difference-between-iskeypressed-and-iskeyjustpressed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!