Documentation ¶
Overview ¶
The touch Pacakge handles touch events in the gl context To capture events as they happen you can use the callbacks OnTouchPress, OnTouchRelease, and OnTouchMove. Define them by calling touch.OnTouchPress = func(x, y, dx, dy, pressure float32){}.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // OnTouchPress is a callback that will be called when the press starts. OnTouchPress touchCB // OnTouchPress is a callback that will be called when the press ends. OnTouchRelease touchCB // OnTouchPress is a callback that will be called when the press moves position. OnTouchMove touchCB )
Functions ¶
func Delegate ¶
func Delegate(event *sdl.TouchFingerEvent)
Delegate is used by amore/event to pass events to the touch package. It may also be useful to stub or fake events
func GetPosition ¶
GetPosition will return the x, y coordinates of the touch with the provied id This may cause a panic if the id does not exist. Safer to use GetPosition on a given touch.
func GetPressure ¶
GetPressure will return the pressure for the touch with the given id. This may cause a panic if the id does not exist. Safer to use GetPressure on a given touch.
Types ¶
type Touch ¶
type Touch struct { ID int64 *sdl.TouchFingerEvent }
func (*Touch) GetPosition ¶
GetPosition will return the x, y coordinates of the touch
func (*Touch) GetPressure ¶
GetPressure will return the pressure for the touch