Documentation ¶
Index ¶
- Constants
- Variables
- func LoadDefaultFace(size float64) font.Face
- func LoadFace(fontKey FontKey, size float64) font.Face
- func LoadImageImage(fsys fs.FS, name string) image.Image
- type Animation
- type Blank
- type Button
- type ButtonMode
- type Delayed
- type FaceKey
- type FontKey
- type Image
- type Location
- type Op
- type Origin
- type Paper
- type Position
- type Source
- type Sprite
- func (s *Sprite) ApplyScale(scale float64)
- 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, origin Origin)
- func (s Sprite) Max() Vector2
- func (s Sprite) Min() (min Vector2)
- func (s *Sprite) Move(x, y float64)
- func (s *Sprite) SetScaleToH(h float64)
- func (s *Sprite) SetScaleToW(w 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 ( ButtonModePressed = iota ButtonModeClicked // onClick goes called when mouse button is pressed and released. )
const ( DelayedModeExp = iota // aka DelayedModeConverge DelayedModeLinear )
const ( Left = iota Center Right )
const ( Top = iota Middle Bottom )
const TransDuration = 400 // In milliseconds.
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} )
https://go.dev/play/p/6FsxRuznEtE
var ( ToTick = times.ToTick ToTime = times.ToTime )
var DefaultFont *truetype.Font
var DefaultFontKey = FontKey{"go", "regular"}
var Faces = make(map[FaceKey]font.Face)
var Fonts = make(map[FontKey]*truetype.Font)
Functions ¶
func LoadDefaultFace ¶ added in v0.3.1
Types ¶
type Animation ¶ added in v0.2.4
type Animation []Sprite
func NewAnimationFromImages ¶ added in v0.2.4
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 Delayed ¶ added in v0.3.1
type Delayed struct { Delayed float64 Source float64 // source *float64 Mode int // Todo: custom type? Feedback float64 // contains filtered or unexported fields }
func NewDelayed ¶ added in v0.3.1
type FontKey ¶ added in v0.3.1
Typeface: a style. Type Family: a set of relating styles. Font: a file of Typeface. Font Family: a set of relating fonts. Font Face: a file used for specific style.
type Image ¶ added in v0.3.1
type Image struct{ *ebiten.Image }
func LoadImage ¶ added in v0.3.1
LoadImage returns nil when fails to load image from the path. ebiten.NewImageFromImage will panic when input is nil.
func NewImageXFlipped ¶ added in v0.3.1
func NewImageYFlipped ¶ added in v0.3.1
type Sprite ¶
type Sprite struct { Source Scale Vector2 Filter ebiten.Filter Position Origin Origin AxisReversed [2]bool }
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 NewSpriteFromSource ¶ added in v0.3.1
func (*Sprite) ApplyScale ¶ added in v0.3.1
func (*Sprite) SetScaleToH ¶ added in v0.2.4
func (*Sprite) SetScaleToW ¶ added in v0.2.4
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.