Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DrawingBuilder ¶
type DrawingBuilder interface { InitDrawingOptions() DrawingBuilder Move(dx, dy int) DrawingBuilder SwapLarger(isLarger bool) DrawingBuilder Draw(screen *ebiten.Image, alpha float64) error }
DrawingBuilder Drawing options region considering struct of functions for better formatting anything between InitDrawingOptions and Draw are unordered
type MapSpriter ¶
type MapSpriter interface { Spriter }
MapSpriter also implements spriter
func NewMapSprite ¶
func NewMapSprite(screen Screener, spriteImage, spriteImageLarger *ebiten.Image, x, y int, cities []*City) MapSpriter
NewMapSprite generates new map sprite
type Mapper ¶
type Mapper interface { Padding(ceiling, left, floor, right int) Margin(ceiling, left, floor, right int) }
Mapper struct using Map must have these methods
type MouseStrokeSource ¶
type MouseStrokeSource struct{}
MouseStrokeSource is a StrokeSource implementation of mouse.
func (*MouseStrokeSource) IsJustReleased ¶
func (m *MouseStrokeSource) IsJustReleased() bool
IsJustReleased gets true if the left mouse btn is released
func (*MouseStrokeSource) Position ¶
func (m *MouseStrokeSource) Position() (int, int)
Position gets the current position of the mouse
type Screener ¶
Screener struct must have width and height; basically screen struct to avoid cyclic dep
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite represents an image.
func (*Sprite) InitDrawingOptions ¶
func (s *Sprite) InitDrawingOptions() DrawingBuilder
InitDrawingOptions every method in drawing must be preceded to keep the geom and colorm
func (*Sprite) Move ¶
func (s *Sprite) Move(dx, dy int) DrawingBuilder
Move Moves the image to a location; basically Translate
func (*Sprite) SwapLarger ¶
func (s *Sprite) SwapLarger(isLarger bool) DrawingBuilder
SwapLarger change image to its bigger alternative if true
type Spriter ¶
type Spriter interface { In(x, y int) bool MoveBy(x, y int) DrawingBuilder }
Spriter struct must have sprites methods to be called a sprite
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 generates new struct for the stroke algorithm
func (*Stroke) DraggingObject ¶
func (s *Stroke) DraggingObject() interface{}
DraggingObject gets anything the stroke drags
func (*Stroke) IsReleased ¶
IsReleased returns true if stroke is released
func (*Stroke) PositionDiff ¶
PositionDiff subtracts the stroke between the previous and current state
func (*Stroke) SetDraggingObject ¶
func (s *Stroke) SetDraggingObject(object interface{})
SetDraggingObject sets anything the stroke drags
type StrokeSource ¶
StrokeSource represents a input device to provide strokes.
type TouchStrokeSource ¶
type TouchStrokeSource struct {
ID int
}
TouchStrokeSource is a StrokeSource implementation of touch.
func (*TouchStrokeSource) IsJustReleased ¶
func (t *TouchStrokeSource) IsJustReleased() bool
IsJustReleased gets true if the touch(mobile) is released
func (*TouchStrokeSource) Position ¶
func (t *TouchStrokeSource) Position() (int, int)
Position gets the current position of the touch(mobile)