Documentation ¶
Index ¶
- Constants
- Variables
- func NewImageImageFromFile(fsys fs.FS, name string) image.Image
- type Anchor
- type Animation
- type Blank
- type Button
- type ButtonMode
- type Frames
- type Image
- type Op
- type Position
- type Source
- type Sprite
- func (s Sprite) Draw(dst Image, op Op)
- func (s Sprite) H() float64
- func (s Sprite) In(p Vector2) bool
- func (s Sprite) LeftTop(screenSize Vector2) (v Vector2)
- func (s *Sprite) Locate(x, y float64, anchor Anchor)
- func (s Sprite) Max() Vector2
- func (s Sprite) Min() (min Vector2)
- func (s *Sprite) Move(x, y float64)
- func (s *Sprite) MultiplyScale(scale float64)
- func (s *Sprite) SetSize(w, h float64)
- func (s Sprite) Size() Vector2
- func (s Sprite) SrcSize() Vector2
- func (s Sprite) W() float64
- type Text
- type Timer
- type Vector2
Constants ¶
const ( Left = iota Center Right )
const ( Top = iota Middle Bottom )
const ( ButtonModePressed = iota ButtonModeClicked // onClick goes called when mouse button is pressed and released. )
Variables ¶
var ( LeftTop = struct{ X, Y int }{Left, Top} LeftMiddle = struct{ X, Y int }{Left, Middle} LeftBottom = struct{ X, Y int }{Left, Bottom} CenterTop = struct{ X, Y int }{Center, Top} CenterMiddle = struct{ X, Y int }{Center, Middle} CenterBottom = struct{ X, Y int }{Center, Bottom} RightTop = struct{ X, Y int }{Right, Top} RightMiddle = struct{ X, Y int }{Right, Middle} RightBottom = struct{ X, Y int }{Right, Bottom} )
Functions ¶
Types ¶
type Animation ¶ added in v0.2.4
type Animation []Sprite
func NewAnimation ¶ added in v0.2.4
func NewAnimationFromFile ¶ added in v0.6.0
type Blank ¶ added in v0.3.1
type Blank struct{ Size_ Vector2 }
Blank is for wrapping Sprite with specific Outer size.
type Button ¶
type Button struct { Sprite // contains filtered or unexported fields }
func NewButton ¶ added in v0.2.4
func NewButton(sprite Sprite, onClick func(), mode ButtonMode) Button
type ButtonMode ¶ added in v0.2.4
type ButtonMode int
type Image ¶ added in v0.3.1
type Image struct{ *ebiten.Image }
func NewImageFromFile ¶ added in v0.6.0
NewImageFromFile returns nil when fails to load file from given path. ebiten.NewImageFromImage will panic when input is nil.
func NewImageFromURL ¶ added in v0.6.0
func NewImageXFlipped ¶ added in v0.3.1
func NewImageYFlipped ¶ added in v0.3.1
type Op ¶ added in v0.3.1
type Op struct { colorm.DrawImageOptions ColorM colorm.ColorM }
type Op = ebiten.DrawImageOptions
type Position ¶ added in v0.3.1
type Position = Vector2
Unit of Position is pixel. cf. Location: unit is percent.
type Source ¶ added in v0.3.1
type Source interface { Size() Vector2 Draw(Image, Op) IsEmpty() bool // Whether the source is nil. }
Image, Text, and Blank implement Source.
type Sprite ¶
Sprite is an image or a text drawn in a screen based on its position and scale. DrawImageOptions is not commutative. Do Translate at the final stage.
func NewSpriteFromURL ¶ added in v0.6.0
func (*Sprite) MultiplyScale ¶ added in v0.6.0
type Text ¶ added in v0.3.1
type Text struct {
// contains filtered or unexported fields
}
type Timer ¶ added in v0.2.4
MaxTick, Period == {+, +}: finite drawing with animation. e.g., Judgment. MaxTick, Period == {+, 0}: finite drawing with no animation. e.g., Combo. MaxTick, Period == {0, +}: infinite drawing with animation. e.g., Dancer. MaxTick, Period == {0, 0}: infinite drawing with no animation. e.g., Stage.
func NewTimer ¶ added in v0.2.4
All timer starts at maxTick, hence IsDone() is true at the beginning.