I am a student who uses cocos2d-x 3.10 to create games.
Create a listener on the cocos2d-x EventListenerKeyboard and
Instead of putting functions in onKeyPressed in advance,
such as Unity, bool Input::GetKeyDown (KeyCode keyCode), etc.
I'd like to implement a function that determines whether it's pressed, pressed, or detached.
I can't think of what to implement.
If you don't mind, please reply.
c++ cocos2d-x
According to the Cocos document, you can use the listener EventListenerKeyboard
to determine keyboard events.
According to the original code example, you can first use the lines , EventListenerKeyboard::create()
and then use functions such as onKeyPressed
and onKeyReleased
.
581 PHP ssh2_scp_send fails to send files as intended
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
914 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.