Performing such checks tends to involve using the Gamepad object in conjunction with an animation loop (e.g., requestAnimationFrame), where developers want to make decisions for the current frame based on the state of the gamepad or gamepads. Doing so is often desirable for games or other interactive web pages that need to know the state of a gamepad now vs. We can do much more with the Gamepad object, including holding a reference to it and querying it to find out which buttons and axes are being pressed at any one time. We can use this in order to determine which gamepad (i.e., its ID) had caused the event, since multiple gamepads might be connected at once. As you can see, the gamepad events discussed above include a gamepad property on the event object, which returns a Gamepad object.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |