Documentation ¶
Overview ¶
Package image contains types to deal with nine-slice images, buffered (cached) images, as well as drawing using masks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewImageColor ¶
NewImageColor constructs a new Image that when drawn fills with color c.
Types ¶
type BufferedImage ¶
BufferedImage is a wrapper for an Ebiten Image that helps with caching the Image. As long as Width and Height stay the same, no new Image will be created.
func (*BufferedImage) Image ¶
func (b *BufferedImage) Image() *ebiten.Image
Image returns the internal Ebiten Image. If b.Width or b.Height have changed, a new Image will be created and returned, otherwise the cached Image will be returned.
type DrawFunc ¶
type DrawFunc func(buf *ebiten.Image)
DrawFunc is a function that draws something into buf.
type DrawImageOptionsFunc ¶
type DrawImageOptionsFunc func(opts *ebiten.DrawImageOptions)
A DrawImageOptionsFunc is responsible for setting DrawImageOptions when drawing an image. This is usually used to translate the image.
type MaskedRenderBuffer ¶
type MaskedRenderBuffer struct {
// contains filtered or unexported fields
}
MaskedRenderBuffer is a helper to draw images using a mask.
func NewMaskedRenderBuffer ¶
func NewMaskedRenderBuffer() *MaskedRenderBuffer
NewMaskedRenderBuffer returns a new MaskedRenderBuffer.
func (*MaskedRenderBuffer) Draw ¶
func (m *MaskedRenderBuffer) Draw(screen *ebiten.Image, d DrawFunc, dm DrawFunc)
Draw calls d to draw onto screen, using the mask drawn by dm. The buffer images passed to d and dm are of the same size as screen.
type NineSlice ¶
type NineSlice struct {
// contains filtered or unexported fields
}
A NineSlice is an image that can be drawn with any width and height. It is basically a 3x3 grid of image tiles: The corner tiles are drawn as-is, while the center columns and rows of tiles will be stretched to fit the desired width and height.
func NewNineSlice ¶
NewNineSlice constructs a new NineSlice from i, having columns widths w and row heights h.
func NewNineSliceColor ¶
NewNineSliceColor constructs a new NineSlice that when drawn fills with color c.
func NewNineSliceSimple ¶
func NewNineSliceSimple(image *ebiten.Image, borderWidthHeight int, centerWidthHeight int) *NineSlice
NewNineSliceSimple constructs a new NineSlice from image. borderWidthHeight specifies the width of the left and right column and the height of the top and bottom row. centerWidthHeight specifies the width of the center column and row.