cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.22k stars 1.94k forks source link

mannual docs for gamepad #14317

Open PPpro opened 1 year ago

PPpro commented 1 year ago

we need to add some mannual docs for the gamepad feature, which is supported by this PR: https://github.com/cocos/cocos-engine/pull/11278

OscarLeif commented 1 year ago

Hello from the forums say I can write a more detailed request.

When working on how to implement the Gamepad I'm confused with how the gamepad works. First the documentation says that button south is the A button. But not sure what is the correct layout.

image

In my example project https://github.com/OscarLeif/FlappyBirdCocosCreator

When I try to use the south button it doesn't work as expected this makes work the A button but from the left layout.

if (event.gamepad.buttonSouth.getValue() == 1 && !this.submitAction) { this.CurrentSelected.OnSubmit(); } Not sure if the mapping is wrong.

A cool example saying what layout is cocos using would be great. And what are the platforms where this work, I test android and works, but native windows doesn't work.