mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
inpututil: Rename JustPressedTouches -> JustPressedTouchIDs
This commit is contained in:
parent
342551da8d
commit
db3effe65a
@ -182,7 +182,7 @@ func jump() bool {
|
|||||||
if inpututil.IsMouseButtonJustPressed(ebiten.MouseButtonLeft) {
|
if inpututil.IsMouseButtonJustPressed(ebiten.MouseButtonLeft) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if len(inpututil.JustPressedTouches()) > 0 {
|
if len(inpututil.JustPressedTouchIDs()) > 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -294,12 +294,12 @@ func GamepadButtonPressDuration(id int, button ebiten.GamepadButton) int {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// JustPressedTouches returns touch IDs that are created just in the current frame.
|
// JustPressedTouchIDs returns touch IDs that are created just in the current frame.
|
||||||
//
|
//
|
||||||
// JustPressedTouches might return nil when there is not touch.
|
// JustPressedTouchIDs might return nil when there is not touch.
|
||||||
//
|
//
|
||||||
// JustPressedTouches is concurrent safe.
|
// JustPressedTouchIDs is concurrent safe.
|
||||||
func JustPressedTouches() []int {
|
func JustPressedTouchIDs() []int {
|
||||||
var ids []int
|
var ids []int
|
||||||
theInputState.m.RLock()
|
theInputState.m.RLock()
|
||||||
for id, s := range theInputState.touchDurations {
|
for id, s := range theInputState.touchDurations {
|
||||||
|
Loading…
Reference in New Issue
Block a user