Documentation ¶
Index ¶
- func AutoCrop(img *image.Paletted) image.Image
- func ClonePalette(p color.Palette) color.Palette
- func DrawDistortion(screen *ebiten.Image, page *ebiten.Image, source *ebiten.Image, ...)
- func DrawOutline(screen *ebiten.Image, imageCache *ImageCache, pic *ebiten.Image, x float64, ...)
- func DrawRect(screen *ebiten.Image, rect image.Rectangle, color_ color.Color)
- func DrawTextCursor(screen *ebiten.Image, source *ebiten.Image, cursorX float64, y float64, ...)
- func First[T any](slice []T, default_ T) T
- func ImageRect(x int, y int, img *ebiten.Image) image.Rectangle
- func Lighten(c color.Color, amount float64) color.Color
- func PremultiplyAlpha(c color.RGBA) color.RGBA
- func RotateHue(c color.RGBA, radian float64) color.Color
- func RotateSlice[T any](slice []T, forward bool)
- type AlphaFadeFunc
- type Animation
- func MakeAnimation(frames []*ebiten.Image, loop bool) *Animation
- func MakePaletteRotateAnimation(lbxFile *lbx.LbxFile, index int, rotateIndexLow int, rotateIndexHigh int) *Animation
- func MakeRepeatAnimation(frames []*ebiten.Image, repeats int) *Animation
- func MakeReverseAnimation(frames []*ebiten.Image, loop bool) *Animation
- type Distortion
- type ImageCache
- func (cache *ImageCache) Clear()
- func (cache *ImageCache) GetImage(lbxFile string, spriteIndex int, animationIndex int) (*ebiten.Image, error)
- func (cache *ImageCache) GetImageTransform(lbxFile string, spriteIndex int, animationIndex int, extra string, ...) (*ebiten.Image, error)
- func (cache *ImageCache) GetImages(lbxPath string, index int) ([]*ebiten.Image, error)
- func (cache *ImageCache) GetImagesTransform(lbxPath string, index int, extra string, transform ImageTransformFunc) ([]*ebiten.Image, error)
- func (cache *ImageCache) GetShader(shader shaders.Shader) (*ebiten.Shader, error)
- type ImageTransformFunc
- type Segment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DrawDistortion ¶
func DrawDistortion(screen *ebiten.Image, page *ebiten.Image, source *ebiten.Image, distortion Distortion, options ebiten.DrawImageOptions)
draw 'source' onto 'screen' with a distortion effect * for each segment in 'distortion', make a quad from 'source' where the width is 'source width' / segments in the distortion * the distortion segments define where to place each corner of the quad
func DrawOutline ¶
func DrawTextCursor ¶
func RotateSlice ¶
Types ¶
type AlphaFadeFunc ¶
type AlphaFadeFunc func() float32
func MakeFadeIn ¶
func MakeFadeIn(time uint64, counter *uint64) AlphaFadeFunc
func MakeFadeOut ¶
func MakeFadeOut(time uint64, counter *uint64) AlphaFadeFunc
type Animation ¶
type Animation struct { Frames []*ebiten.Image CurrentFrame int Repeat int // contains filtered or unexported fields }
func MakeAnimation ¶
func MakePaletteRotateAnimation ¶
func MakePaletteRotateAnimation(lbxFile *lbx.LbxFile, index int, rotateIndexLow int, rotateIndexHigh int) *Animation
create an animation by rotating the colors in a palette for a given lbx/index pair. * all the colors between indexLow and indexHigh will be rotated once in the animation
func MakeRepeatAnimation ¶
func MakeReverseAnimation ¶
type ImageCache ¶
type ImageCache struct { LbxCache *lbx.LbxCache // FIXME: have some limit on the number of entries, and remove old ones LRU-style Cache map[string][]*ebiten.Image ShaderCache map[shaders.Shader]*ebiten.Shader }
func MakeImageCache ¶
func MakeImageCache(lbxCache *lbx.LbxCache) ImageCache
func (*ImageCache) GetImage ¶
func (cache *ImageCache) GetImage(lbxFile string, spriteIndex int, animationIndex int) (*ebiten.Image, error)
func (*ImageCache) GetImageTransform ¶
func (cache *ImageCache) GetImageTransform(lbxFile string, spriteIndex int, animationIndex int, extra string, transform ImageTransformFunc) (*ebiten.Image, error)
func (*ImageCache) GetImages ¶
func (cache *ImageCache) GetImages(lbxPath string, index int) ([]*ebiten.Image, error)
func (*ImageCache) GetImagesTransform ¶
func (cache *ImageCache) GetImagesTransform(lbxPath string, index int, extra string, transform ImageTransformFunc) ([]*ebiten.Image, error)
Click to show internal directories.
Click to hide internal directories.