Add package nintendoswitch

Updates #744
This commit is contained in:
Hajime Hoshi 2021-03-21 21:00:10 +09:00
parent 402e1a251a
commit 0dbe5b37de
2 changed files with 52 additions and 0 deletions

View File

@ -45,6 +45,7 @@ For installation on desktops, see [the installation instruction](https://ebiten.
* [ebitenutil](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/ebitenutil) * [ebitenutil](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/ebitenutil)
* [inpututil](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/inpututil) * [inpututil](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/inpututil)
* [mobile](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/mobile) * [mobile](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/mobile)
* [nintendoswitch](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/nintendoswitch)
* [text](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/text) * [text](https://pkg.go.dev/github.com/hajimehoshi/ebiten/v2/text)
## Community ## Community

51
nintendoswitch/gamepad.go Normal file
View File

@ -0,0 +1,51 @@
// Copyright 2021 The Ebiten Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package nintendoswitch provides utility APIs for Nintendo Switch.
package nintendoswitch
import (
"github.com/hajimehoshi/ebiten/v2"
)
const (
GamepadButtonA = ebiten.GamepadButton0
GamepadButtonB = ebiten.GamepadButton1
GamepadButtonX = ebiten.GamepadButton2
GamepadButtonY = ebiten.GamepadButton3
GamepadButtonStickL = ebiten.GamepadButton4
GamepadButtonStickR = ebiten.GamepadButton5
GamepadButtonL = ebiten.GamepadButton6
GamepadButtonR = ebiten.GamepadButton7
GamepadButtonZL = ebiten.GamepadButton8
GamepadButtonZR = ebiten.GamepadButton9
GamepadButtonPlus = ebiten.GamepadButton10
GamepadButtonMinus = ebiten.GamepadButton11
GamepadButtonLeft = ebiten.GamepadButton12
GamepadButtonUp = ebiten.GamepadButton13
GamepadButtonRight = ebiten.GamepadButton14
GamepadButtonDown = ebiten.GamepadButton15
GamepadButtonStickLLeft = ebiten.GamepadButton16
GamepadButtonStickLUp = ebiten.GamepadButton17
GamepadButtonStickLRight = ebiten.GamepadButton18
GamepadButtonStickLDown = ebiten.GamepadButton19
GamepadButtonStickRLeft = ebiten.GamepadButton20
GamepadButtonStickRUp = ebiten.GamepadButton21
GamepadButtonStickRRight = ebiten.GamepadButton22
GamepadButtonStickRDown = ebiten.GamepadButton23
GamepadButtonLeftSL = ebiten.GamepadButton24
GamepadButtonLeftSR = ebiten.GamepadButton25
GamepadButtonRightSL = ebiten.GamepadButton26
GamepadButtonRightSR = ebiten.GamepadButton27
)