Documentation
¶
Overview ¶
Package image contains types to deal with nine-slice images, buffered (cached) images, as well as drawing using masks.
Index ¶
- func NewBorder(borderTop int, borderRight int, borderBottom int, borderLeft int, ...) borders
- func NewImageColor(c color.Color) *ebiten.Image
- type BufferedImage
- type DrawFunc
- type DrawImageOptionsFunc
- type MaskedRenderBuffer
- type NineSlice
- func NewAdvancedNineSliceColor(bodyColor color.Color, border borders) *NineSlice
- func NewAdvancedNineSliceImage(img *ebiten.Image, border borders) *NineSlice
- func NewBorderedNineSliceColor(bodyColor color.Color, borderColor color.Color, borderWidth int) *NineSlice
- func NewBorderedNineSliceImage(img *ebiten.Image, borderColor color.Color, borderWidth int) *NineSlice
- func NewFixedNineSlice(i *ebiten.Image) *NineSlice
- func NewNineSlice(i *ebiten.Image, w [3]int, h [3]int) *NineSlice
- func NewNineSliceBorder(image *ebiten.Image, borderWidthHeight int) *NineSlice
- func NewNineSliceColor(c color.Color) *NineSlice
- func NewNineSliceSimple(image *ebiten.Image, borderWidthHeight int, centerWidthHeight int) *NineSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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.
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 NewAdvancedNineSliceColor ¶ added in v0.6.2
NewAdvancedNineSliceColor constructs a new NineSlice that when drawn fills with color c and has a border defined by the borders struct.
func NewAdvancedNineSliceImage ¶ added in v0.6.2
NewAdvancedNineSliceImage constructs a new NineSlice that when drawn fills with the provided image and has a border defined by the borders struct.
func NewBorderedNineSliceColor ¶ added in v0.6.2
func NewBorderedNineSliceColor(bodyColor color.Color, borderColor color.Color, borderWidth int) *NineSlice
NewBorderedNineSliceColor constructs a new NineSlice that when drawn fills with color c and has a border with the specified color and width.
func NewBorderedNineSliceImage ¶ added in v0.6.2
func NewBorderedNineSliceImage(img *ebiten.Image, borderColor color.Color, borderWidth int) *NineSlice
NewBorderedNineSliceColor constructs a new NineSlice that when drawn fills with the provided image and has a border with the specified color and width.
func NewFixedNineSlice ¶ added in v0.7.0
func NewNineSlice ¶
NewNineSlice constructs a new NineSlice from i, having columns widths w and row heights h.
func NewNineSliceBorder ¶ added in v0.6.1
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. The center width and height is computed as the width of image minus 2*borderWidthHeight.
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.