input

package
v0.0.0-...-1330837 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType int
const (
	Start EventType = iota + 1
	Move
	Tap
	Stop
	Cancel
)

type MouseStrokeSource

type MouseStrokeSource struct{}

func (*MouseStrokeSource) IsJustReleased

func (m *MouseStrokeSource) IsJustReleased() bool

func (*MouseStrokeSource) Position

func (m *MouseStrokeSource) Position() (int, int)

type Observable

type Observable interface {
	Add(Observer)
	Remove(Observer)
	Notify(StrokeEvent)
}

type Stroke

type Stroke struct {
	Cancelled     bool
	DraggedObject any
	// contains filtered or unexported fields
}

func NewStroke

func NewStroke(source StrokeSource) *Stroke

func StartStroke

func StartStroke(observer Observer) *Stroke

func (*Stroke) Add

func (s *Stroke) Add(observer Observer)

func (*Stroke) IsReleased

func (s *Stroke) IsReleased() bool

func (*Stroke) Notify

func (s *Stroke) Notify(event StrokeEvent)

func (*Stroke) Position

func (s *Stroke) Position() (int, int)

func (*Stroke) PositionDiff

func (s *Stroke) PositionDiff() (int, int)

func (*Stroke) Remove

func (s *Stroke) Remove(observer Observer)

func (*Stroke) Update

func (s *Stroke) Update()

type StrokeEvent

type StrokeEvent struct {
	Event  EventType
	Stroke *Stroke
	Object any
	X, Y   int
}

type StrokeSource

type StrokeSource interface {
	Position() (int, int)
	IsJustReleased() bool
}

https://ebiten.org/examples/drag.html

type TouchStrokeSOurce

type TouchStrokeSOurce struct {
	ID ebiten.TouchID
}

func (*TouchStrokeSOurce) IsJustReleased

func (t *TouchStrokeSOurce) IsJustReleased() bool

func (*TouchStrokeSOurce) Position

func (t *TouchStrokeSOurce) Position() (int, int)

type WheelStrokeSource

type WheelStrokeSource struct{}

func (*WheelStrokeSource) IsJustReleased

func (w *WheelStrokeSource) IsJustReleased() bool

func (*WheelStrokeSource) Position

func (w *WheelStrokeSource) Position() (int, int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL