mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
examples/gamepad: Bug fix: Misuse of indices and gamepad IDs
This commit is contained in:
parent
0673b384d8
commit
bb20e62435
@ -91,7 +91,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
|||||||
ids = append(ids, id)
|
ids = append(ids, id)
|
||||||
}
|
}
|
||||||
sort.Ints(ids)
|
sort.Ints(ids)
|
||||||
for id := range ids {
|
for _, id := range ids {
|
||||||
str += fmt.Sprintf("Gamepad (ID: %d, SDL ID: %s):\n", id, ebiten.GamepadSDLID(id))
|
str += fmt.Sprintf("Gamepad (ID: %d, SDL ID: %s):\n", id, ebiten.GamepadSDLID(id))
|
||||||
str += fmt.Sprintf(" Axes: %s\n", strings.Join(g.axes[id], ", "))
|
str += fmt.Sprintf(" Axes: %s\n", strings.Join(g.axes[id], ", "))
|
||||||
str += fmt.Sprintf(" Buttons: %s\n", strings.Join(g.pressedButtons[id], ", "))
|
str += fmt.Sprintf(" Buttons: %s\n", strings.Join(g.pressedButtons[id], ", "))
|
||||||
|
Loading…
Reference in New Issue
Block a user