Documentation
¶
Index ¶
- Constants
- type Animation
- func (anime *Animation) Angle() float64
- func (anime *Animation) Clone() *Animation
- func (anime *Animation) Draw(screen *ebiten.Image)
- func (anime *Animation) FlipH() bool
- func (anime *Animation) FlipV() bool
- func (anime *Animation) Height() float64
- func (anime *Animation) Index() int
- func (anime *Animation) IsFinished() bool
- func (anime *Animation) IsPlaying() bool
- func (anime *Animation) Length() int
- func (anime *Animation) Pause()
- func (anime *Animation) PlayFromStart()
- func (anime *Animation) Position() (float64, float64)
- func (anime *Animation) Random()
- func (anime *Animation) Resume()
- func (anime *Animation) ScaleX() float64
- func (anime *Animation) ScaleY() float64
- func (anime *Animation) SetAngle(angle float64)
- func (anime *Animation) SetDuration(dur time.Duration)
- func (anime *Animation) SetFlipH(flipH bool)
- func (anime *Animation) SetFlipV(flipV bool)
- func (anime *Animation) SetFrames(frames AnimeFrames)
- func (anime *Animation) SetIndex(index int)
- func (anime *Animation) SetLooping(looping bool)
- func (anime *Animation) SetOrigin(x, y float64)
- func (anime *Animation) SetPosition(x, y float64)
- func (anime *Animation) SetScale(scaleX, scaleY float64)
- func (anime *Animation) SetX(x float64)
- func (anime *Animation) SetY(y float64)
- func (anime *Animation) Size() (float64, float64)
- func (anime *Animation) Update(elapsedTime time.Duration)
- func (anime *Animation) Width() float64
- func (anime *Animation) X() float64
- func (anime *Animation) Y() float64
- type AnimeFrames
- type Frame
- type Image
- type Origin
- type Packer
- type Rectangle
- type SimplePacker
- type Status
- type SubImage
- type Texture
- type TextureId
Constants ¶
const ( Playing = iota Paused Finished )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct {
// contains filtered or unexported fields
}
AnimeOptions represents an anime
func NewAnimation ¶
func NewAnimation(frames AnimeFrames) *Animation
NewAnimation craetes anime new Animation
func (*Animation) IsFinished ¶
IsFinished returns if the anime is finished
func (*Animation) PlayFromStart ¶
func (anime *Animation) PlayFromStart()
PlayFromStart start the anime from the start frame
func (*Animation) SetDuration ¶
SetDuration sets the duration of each frames
func (*Animation) SetFrames ¶
func (anime *Animation) SetFrames(frames AnimeFrames)
SetFrames sets the frame of the anime
func (*Animation) SetLooping ¶
SetLooping sets looping flag
func (*Animation) SetPosition ¶
SetPosition sets the current index of the anime
type AnimeFrames ¶
type AnimeFrames []*Frame
type Packer ¶
type Packer struct {
// contains filtered or unexported fields
}
Packer packs multiple images into a single image dynamically for performance reasons
func (*Packer) PackedImage ¶
func (packer *Packer) PackedImage() *ebiten.Image
PackedImage returns the underlying packedImage
type SimplePacker ¶
type SimplePacker struct{}
SimplePacker packs rectagles with a simple algorithm
func (SimplePacker) Pack ¶
func (packer SimplePacker) Pack(R []*Rectangle, maxWidth, maxHeight int)
Pack computes rectangle locations without overlapping
type Texture ¶
type Texture struct {
// contains filtered or unexported fields
}
Texture represents a texture
func NewTexture ¶
NewTexture creates a new texture
func (*Texture) Frames ¶
Frames returns the []Frames that is specified by the args Ex1: Frames(1, 3) -> returns 1 and 3 frames. parameter indicates the frame indices starting left-top to right-bottom Ex2: Frames("1-6") -> equivalent to Frames(1, 2, 3, 4, 5, 6) Ex3: Frames() -> equivalent to all frames