Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Atlas ¶
type Atlas struct {
// contains filtered or unexported fields
}
Atlas is a minimal write-only container for sub-images, that can be used with a DrawList to batch draw commands as triangles.
func New ¶
func New(width, height int, opts *NewAtlasOptions) *Atlas
type DrawCommand ¶
type DrawCommand struct { Image *Image ColorScale ebiten.ColorScale GeoM ebiten.GeoM }
DrawCommand is the equivalent of the regular DrawImageOptions but only including options that will not break batching. Filter, Address, Blend and AntiAlias are determined at Flush()
type DrawList ¶
type DrawList struct {
// contains filtered or unexported fields
}
DrawList stores triangle versions of DrawImage calls when all images are sub-images of an atlas. Temporary vertices and indices can be re-used after calling Flush, so it is more efficient to keep a reference to a DrawList instead of creating a new one every frame.
func (*DrawList) Add ¶
func (dl *DrawList) Add(commands ...*DrawCommand)
Add adds DrawImage commands to the DrawList, images from multiple atlases can be added but they will break the previous batch bound to a different atlas, requiring an additional draw call internally. So, it is better to have the maximum of consecutive DrawCommand images sharing the same atlas.
func (*DrawList) Flush ¶
func (dl *DrawList) Flush(dst *ebiten.Image, opts *DrawOptions)
Flush executes all the draw commands as the smallest possible amount of draw calls, and then clears the list for next uses.
type DrawOptions ¶
type DrawOptions struct { ColorScaleMode ebiten.ColorScaleMode Blend ebiten.Blend Filter ebiten.Filter Address ebiten.Address AntiAlias bool }
DrawOptions are additional options that will be applied to all draw commands from the draw list when calling Flush().
type Image ¶
type Image struct {
// contains filtered or unexported fields
}