Why do the examples use the build tag example?

With the build tag, go get -u github.com/hajimehoshi/ebiten/... doesn't install the example binaries in your $GOPATH/bin.

Such build tags are an idiom you can find e.g. in golang.org/x/exp/shiny/example.

How can I run the examples on browsers?

Run gopherjs serve --tags=example and see e.g.,

My app built with Ebiten creates an unknown process "Console Window Host". What is this?

This is because your app is still a console app, not a GUI app. Ebiten tries to close the console when necessary, but the app itself is still not recognized as a GUI app. You can suppress this by specifying ldflags when go-building like this:

go build -ldflags -H=windowsgui path/to/your/game

Why did you name the lib "Ebiten"?

It's because Ebiten is delicious.


How to draw lines?

Use ebitenutil.DrawLine. Note that this function is only for debugging and prototyping only.

See the discussion #137 on other primitive drawings.

How to take a screenshot?

Specify the key to environment variable EBITEN_SCREENSHOT_KEY and you can take a screenshot by pressing the specified key.

EBITEN_SCREENSHOT_KEY=escape go run examples/flappy.go

Ebiten's screen is scaled (and blurred) on high-DPI screen. Can I disable this scaling? In other words, can I have a hi-DPI mode?

You can pass 1 / ebiten.DeviceScaleFactor() to Run's scale argument so that you can get the screen without scaling by the device scale. For an actual example, see examples/highdpi.