Documentation ¶
Overview ¶
Package ebitenutil provides utility functions for Ebitengine.
Index ¶
- func DebugPrint(image *ebiten.Image, str string)
- func DebugPrintAt(image *ebiten.Image, str string, x, y int)
- func DrawCircle(dst *ebiten.Image, cx, cy, r float64, clr color.Color)deprecated
- func DrawLine(dst *ebiten.Image, x1, y1, x2, y2 float64, clr color.Color)deprecated
- func DrawRect(dst *ebiten.Image, x, y, width, height float64, clr color.Color)deprecated
- func NewImageFromFile(path string) (*ebiten.Image, image.Image, error)
- func NewImageFromFileSystem(fs fs.FS, path string) (*ebiten.Image, image.Image, error)
- func NewImageFromReader(reader io.Reader) (*ebiten.Image, image.Image, error)
- func NewImageFromURL(url string) (*ebiten.Image, error)
- type ReadSeekCloserdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugPrint ¶
func DebugPrint(image *ebiten.Image, str string)
DebugPrint draws the string str on the image at (0, 0) position (the upper-left corner in most cases).
The available runes are in U+0000 to U+00FF, which is C0 Controls and Basic Latin and C1 Controls and Latin-1 Supplement.
func DebugPrintAt ¶
DebugPrintAt draws the string str on the image at (x, y) position.
The available runes are in U+0000 to U+00FF, which is C0 Controls and Basic Latin and C1 Controls and Latin-1 Supplement.
func DrawCircle
deprecated
added in
v2.4.0
func DrawLine
deprecated
func DrawRect
deprecated
func NewImageFromFile ¶
NewImageFromFile loads the file with path and returns ebiten.Image and image.Image.
Image decoders must be imported when using NewImageFromFile. For example, if you want to load a PNG image, you'd need to add `_ "image/png"` to the import section.
How to solve path depends on your environment. This varies on your desktop or web browser. Note that this doesn't work on mobiles.
For productions, instead of using NewImageFromFile, it is safer to embed your resources with go:embed.
func NewImageFromFileSystem ¶ added in v2.4.0
NewImageFromFileSystem create an image from the specified file system.
Image decoders must be imported when using NewImageFromReader. For example, if you want to load a PNG image, you'd need to add `_ "image/png"` to the import section.
func NewImageFromReader ¶ added in v2.2.0
NewImageFromReader loads from the io.Reader and returns ebiten.Image and image.Image.
Image decoders must be imported when using NewImageFromReader. For example, if you want to load a PNG image, you'd need to add `_ "image/png"` to the import section.
func NewImageFromURL ¶
NewImageFromURL creates a new ebiten.Image from the given URL.
Image decoders must be imported when using NewImageFromURL. For example, if you want to load a PNG image, you'd need to add `_ "image/png"` to the import section.
Types ¶
type ReadSeekCloser
deprecated
type ReadSeekCloser interface { io.ReadSeeker io.Closer }
ReadSeekCloser is io.ReadSeeker and io.Closer.
Deprecated: as of v2.4. Use io.ReadSeekCloser instead.
func OpenFile
deprecated
func OpenFile(path string) (ReadSeekCloser, error)
OpenFile opens a file and returns a stream for its data.
The path parts should be separated with slash '/' on any environments.
OpenFile doesn't work on mobiles.
Deprecated: as of v2.4. Use os.Open on desktops and http.Get on browsers instead.