Updated FAQ (markdown)

Hajime Hoshi 2018-04-11 01:05:47 +09:00
parent d6f0ca37c4
commit c74ac1e752

22
FAQ.md

@ -32,26 +32,10 @@ See [the discussion #137](https://github.com/hajimehoshi/ebiten/issues/137) on o
## How to take a screenshot? ## How to take a screenshot?
As a `ebiten.Image` is just a standard `image.Image`, you can pass it to, e.g. `png.Encode`. Specify the key to environment variable `EBITEN_SCREENSHOT_KEY` and you can take a screenshot by pressing the specified key.
```go ```sh
func update(screen *ebiten.Image) error { EBITEN_SCREENSHOT_KEY=escape go run examples/flappy.go
// update logic
// render to the screen
if needsToTakeScreenshot {
f, err := os.Create("screen.png")
defer f.Close()
if err != nil {
return err
}
if err := png.Encode(f, screen); err != nil {
return err
}
}
return nil
}
``` ```
## Ebiten's screen is scaled (and blurred) on high-DPI screen. Can I disable this scaling? In other words, can I have a high-DPI mode? ## Ebiten's screen is scaled (and blurred) on high-DPI screen. Can I disable this scaling? In other words, can I have a high-DPI mode?