The Go team has released version 1.8 of its 2D game library called Ebiten, yesterday. Ebiten 1.8 comes with new features such as experimental WebAssembly Port, newly added APIs, and bug fixes among other updates.
Ebiten is a very simple 2D game library in Go that offers 2D graphics (Geometry/Color matrix transformation, Various composition modes, Offscreen rendering, Fullscreen, Text rendering), input and audio support.
Experimental WebAssembly Port
The Go team has added a WebAssembly port to Ebiten 1.8, but this is still in the experimental phase. This new feature compiles to a single WebAssembly module including the Go runtime for goroutine scheduling, garbage collection, maps, and other Go essentials, that results in a module of at least 2MB, or 500KB when compressed.
WebAssembly refers to a binary instruction format for a stack-based virtual machine. It is designed for the compilation of high-level languages such as C/C++/Rust. This helps with easily deploying the apps on client and server applications.
New APIs added
New APIs have been added for different features such as polygon, TPS, Vsync, Package audio, and Package ebitenutil, in Ebiten 1.8.
- For polygon, type DrawTrianglesOptions API has been added which represents options to render triangles on an image. Another API type Vertex has also been added that represents a vertex passed to DrawTriangles.
- For TPS, func CurrentTPS() float64 API is added that returns the current TPS and represents the number of update functions called in a second. Another added API, func MaxTPS() int: returns the current maximum TPS. Also, func SetMaxTPS(tps int) API is added that sets the maximum TPS (ticks per second) and represents the number of the updating function called per second.
- For Vsync, func IsVsyncEnabled() bool API returns a boolean value that indicates if the game is using the display’s vsync. Another func SetVsyncEnabled(enabled bool) API sets a boolean value that indicates if the game uses the display’s vsync.
- For Package audio, the func (c *Context) IsReady() bool API returns a boolean value that indicates whether the audio is ready or not. For Package ebitenutil, func DebugPrintAt(image *ebiten.Image, str string, x, y int) API draws the string str on the image at (x, y) position.
The bug causing multi monitors issue has been fixed. Also, issues related to macOS 10.14 Mojave has been fixed.
For more information, check out the official release notes.