Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugPrint ¶
DebugPrint draws the string str on the image.
func NewImageFromFile ¶
NewImageFromFile loads the file path and returns ebiten.Image and image.Image.
The current directory for path depends on your environment. This will vary on your desktop or web browser. Note that this doesn't work on mobiles. It'll be safer to embed your resource, e.g., with github.com/jteeuwen/go-bindata instead of using this function.
func RecordScreenAsGIF ¶
func RecordScreenAsGIF(update func(*ebiten.Image) error, out io.Writer, frameNum int) func(*ebiten.Image) error
RecordScreenAsGIF returns updating function with recording the screen as an animation GIF image.
This encodes each screen at each frame and may slows the application.
Here is the example to record initial 120 frames of your game:
func update(screen *ebiten.Image) error { // ... } func main() { out, err := os.Create("output.gif") if err != nil { log.Fatal(err) } defer out.Close() update := RecordScreenAsGIF(update, out, 120) if err := ebiten.Run(update, 320, 240, 2, "Your game's title"); err != nil { log.Fatal(err) } }
Types ¶
type ReadSeekCloser ¶ added in v1.3.0
type ReadSeekCloser interface { io.ReadSeeker io.Closer }
ReadSeekCloser is io.ReadSeeker and io.Closer.
func OpenFile ¶ added in v1.3.0
func OpenFile(path string) (ReadSeekCloser, error)
OpenFile opens a file and returns a stream for its data.
This function is available both on desktops and browsers. Note that this doesn't work on mobiles.