Documentation ¶
Index ¶
- Constants
- Variables
- func NewImage(path string) *ebiten.Image
- func NewImageImage(path string) image.Image
- func NewScaledImage(i *ebiten.Image, scale float64) *ebiten.Image
- func NewXFlippedImage(i *ebiten.Image) *ebiten.Image
- func NewYFlippedImage(i *ebiten.Image) *ebiten.Image
- type Align
- type AnimationDrawer
- type BaseDrawer
- type Box
- type Button
- type Grid
- type Label
- type ModeXY
- type Origin
- type Origin2
- type Point
- type Rectangle
- type Sprite
- func (s Sprite) Draw(screen *ebiten.Image, opSrc *ebiten.DrawImageOptions)
- func (s Sprite) Filter() ebiten.Filter
- func (s Sprite) H() float64
- func (s Sprite) In(x, y float64) bool
- func (s Sprite) IsValid() bool
- func (s Sprite) LeftTopX() float64
- func (s Sprite) LeftTopY() float64
- func (s *Sprite) Move(tx, ty float64)
- func (s Sprite) Origin() Origin
- func (s *Sprite) SetPosition(x, y float64, origin Origin)
- func (s *Sprite) SetScale(scale float64)
- func (s *Sprite) SetScaleXY(scaleW, scaleH float64, filter ebiten.Filter)
- func (s Sprite) Size() (float64, float64)
- func (s Sprite) SrcSize() (int, int)
- func (s Sprite) W() float64
- func (s Sprite) X() float64
- func (s Sprite) Y() float64
- type Sprite3
- type Subject
Constants ¶
View Source
const ( OriginLeft = iota OriginCenter OriginRight )
View Source
const ( OriginTop = iota OriginMiddle OriginBottom )
View Source
const ( AlignLeft = iota AlignCenter AlignRight )
View Source
const ( AlignTop = iota AlignMiddle AlignBottom )
View Source
const ( ModeMin = iota ModeMid ModeMax )
View Source
const ( ButtonModePressed = iota ButtonModeClicked // onClick goes called when mouse button is pressed and released. )
Variables ¶
Functions ¶
func NewImage ¶
func NewImage(path string) *ebiten.Image
NewImage returns nil when fails to load image from the path.
func NewScaledImage ¶
func NewScaledImage(i *ebiten.Image, scale float64) *ebiten.Image
func NewXFlippedImage ¶
func NewXFlippedImage(i *ebiten.Image) *ebiten.Image
func NewYFlippedImage ¶
func NewYFlippedImage(i *ebiten.Image) *ebiten.Image
Types ¶
type AnimationDrawer ¶
type AnimationDrawer struct { Time int64 Duration int64 // float64 StartTime int64 // EndTime int64 // Cycle int Sprites []Sprite }
func (AnimationDrawer) Draw ¶
func (d AnimationDrawer) Draw(screen *ebiten.Image, op *ebiten.DrawImageOptions, tx, ty float64)
func (AnimationDrawer) Frame ¶
func (d AnimationDrawer) Frame() int
func (*AnimationDrawer) Update ¶
func (d *AnimationDrawer) Update(time, duration int64, reset bool)
func (d *AnimationDrawer) SetTime(time, duration int64) { d.Time = time d.StartTime = time d.EndTime = time + duration }
type BaseDrawer ¶
Countdown is for drawing a sprite for a while.
func (BaseDrawer) Age ¶
func (d BaseDrawer) Age() float64
Todo: should I handle when MaxCountdown == 0?
func (*BaseDrawer) Update ¶
func (d *BaseDrawer) Update(reloaded bool)
type Box ¶
Box is wrapped Subject(Sprite, Label) with Position data.
type Origin ¶
type Origin int
const ( OriginLeftTop Origin = iota // Default Origin. OriginLeftMiddle // e.g., Notes in Piano mode. OriginLeftBottom // e.g., back button. OriginCenterTop // e.g., drawing field. OriginCenterMiddle // Most of sprite's Origin. OriginCenterBottom // e.g., Meter. OriginRightTop // e.g., score. OriginRightMiddle // e.g., chart info boxes. OriginRightBottom // e.g., Play button. )
type Point ¶
type Point struct{ X, Y float64 }
type Sprite ¶
type Sprite struct {
// contains filtered or unexported fields
}
Sprite is a image drawn in screen based on its position and scale. DrawImageOptions is not commutative. Do translate at final stage. Todo: embed Text?
func NewSpriteFromImage ¶
func NewSpriteFromImage(src *ebiten.Image) Sprite
func (*Sprite) SetPosition ¶
func (*Sprite) SetScaleXY ¶
type Sprite3 ¶
type Sprite3 struct { Scale Point // contains filtered or unexported fields }
Sprite is a scaled image. Sprite3's i is nil if Sprite3 is a placeholder or failed to load an image.
func NewSprite3 ¶
func NewSprite3FromImage ¶
func NewSprite3FromImage(i *ebiten.Image) *Sprite3
Click to show internal directories.
Click to hide internal directories.