Installation of the module
You must have a gamepad module installed on your project:
npx rpgjs add @rpgjs/gamepad
Customize the gamepad notification
gamepad property in the configuration object in
[gamepad.connect] message = "Your gamepad is connected !" time = 2000 icon = "icon_id" sound = "sound_id" [gamepad.disconnect] message = "Your gamepad is disconnected !" time = 2000 icon = "icon_id" sound = "sound_id"
- The class has two static methods, connect and disconnect.
- Each of these methods has a message, time, icon and sound property.
- The connect and disconnect methods are called when the gamepad is connected and disconnected.
- The message property is the message that will be displayed in the notification.
- The time property is the time in milliseconds that the notification will be displayed.
- The icon property is the icon that will be displayed in the notification. Remember to create the client-side spritesheet before
- The sound property is the sound that will be played when the notification is displayed. Remember to create the client-side sound before. If you don't want to put any sound, put the