Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mesh ¶
type Mesh struct {
// contains filtered or unexported fields
}
Mesh represents set of triangles.
func NewMesh ¶
func NewMesh(ebitenImage *ebiten.Image, vertices []ebiten.Vertex, indeces []uint16, x, y, screenWidth, screenHeight int) *Mesh
NewMesh generates new mesh with farthest vector
func (*Mesh) GetPosition ¶
GetPosition gives the displacement position of the of the whole mesh
type MouseStrokeSource ¶
type MouseStrokeSource struct {
// contains filtered or unexported fields
}
MouseStrokeSource is a StrokeSource implementation of mouse.
func (*MouseStrokeSource) IsJustReleased ¶
func (m *MouseStrokeSource) IsJustReleased() bool
IsJustReleased asks if the mouse button is up
func (*MouseStrokeSource) Position ¶
func (m *MouseStrokeSource) Position() (int, int)
Position gives the current position by a mouse
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite represents an image.
func (*Sprite) GetPosition ¶
GetPosition gives the current position of the sprite
type Spriter ¶
type Spriter interface { MoveBy(x, y int) GetPosition() (int, int) Draw(screen *ebiten.Image, dx, dy int, alpha float64) }
Spriter will match mesh and sprite structs. only difference is that mesh will contain triangle vertices nad indeces
type Stroke ¶
type Stroke struct {
// contains filtered or unexported fields
}
Stroke manages the current drag state by mouse.
func NewStroke ¶
func NewStroke(source StrokeSource) *Stroke
NewStroke asks for devices' custom controls and provides custom default values
func (*Stroke) DraggingSprite ¶
DraggingSprite gives the Spriter being dragged
func (*Stroke) IsReleased ¶
IsReleased asks if the mouse button is up
func (*Stroke) PositionDiff ¶
PositionDiff gives the position after the change from initial to current
func (*Stroke) SetDraggingSpriter ¶
SetDraggingSpriter sets the Spriter to be dragged
type StrokeSource ¶
StrokeSource represents a input device to provide strokes.
type View ¶
type View struct {
// contains filtered or unexported fields
}
View controls the state of the game
func NewView ¶
func NewView(ebitenImage *ebiten.Image, x, y, screenWidth, screenHeight int, trigger ebiten.MouseButton) *View
NewView gives custom default values
func NewViewWithMesh ¶
func NewViewWithMesh(ebitenImage *ebiten.Image, vertices []ebiten.Vertex, indeces []uint16, x, y, screenWidth, screenHeight int, trigger ebiten.MouseButton) *View
NewViewWithMesh gives custom default values