ebiten/docs/index.html

204 lines
12 KiB
HTML
Raw Normal View History

2014-12-27 16:26:33 +01:00
<!DOCTYPE html>
2017-08-18 16:26:17 +02:00
<meta charset="utf-8">
<meta property="og:image" itemprop="image primaryImageOfPage" content="https://hajimehoshi.github.io/ebiten/images/logo.png">
2018-02-02 14:40:41 +01:00
<meta name="description" content="Ebiten - A dead simple 2D game library in Go">
2015-01-10 11:18:43 +01:00
<link rel="shortcut icon" href="./favicon.png" type="image/png">
<link rel="icon" href="./favicon.png" type="image/png">
2018-02-02 14:40:41 +01:00
<title>Ebiten - A dead simple 2D game library in Go</title>
2017-08-18 16:26:17 +02:00
2016-08-27 17:48:15 +02:00
<link rel="stylesheet" href="./stylesheets/bootstrap.min.css">
<link rel="stylesheet" href="./stylesheets/highlight-github.css">
<link rel="stylesheet" href="./stylesheets/ebiten.css">
<script src="./scripts/googleanalytics.js"></script>
2016-08-26 19:28:57 +02:00
2017-08-17 20:00:05 +02:00
<nav class="navbar"><div class="container">
<div class="d-flex flex-row" style="width: 100%;">
<div class="nav"><a class="navbar-brand" href="./"><img src="images/logo_white.svg" alt="EBITEN"></a></div>
<ul class="nav mr-auto align-middle">
2017-08-17 18:22:19 +02:00
<li class="nav-item"><a class="nav-link" href="#platforms">Platforms</a></li>
<li class="nav-item"><a class="nav-link" href="#features">Features</a></li>
<li class="nav-item"><a class="nav-link" href="#examples">Examples</a></li>
<li class="nav-item"><a class="nav-link" href="#projects-with-ebiten">Projects with Ebiten</a></li>
2017-08-17 18:22:19 +02:00
<li class="nav-item"><a class="nav-link" href="#getting-started">Getting Started</a></li>
2016-08-26 19:37:08 +02:00
</ul>
2017-08-17 18:22:19 +02:00
<ul class="nav">
<li class="nav-item"><a class="nav-link" href="https://github.com/hajimehoshi/ebiten">GitHub</a></li>
<li class="nav-item"><a class="nav-link" href="https://godoc.org/github.com/hajimehoshi/ebiten">GoDoc</a></li>
2018-03-26 16:19:02 +02:00
<li class="nav-item"><a class="nav-link" href="https://github.com/hajimehoshi/ebiten/wiki">Wiki</a></li>
2016-08-26 19:37:08 +02:00
</ul>
2017-08-17 20:00:05 +02:00
</div>
</div></nav>
<header class="jumbotron jumbotron-fluid"><div class="container text-center">
<h1><img src="images/logo.svg" alt="EBITEN" style="width: 220px; height: 242px;"></h1>
2018-02-02 14:40:41 +01:00
<p class="lead">A dead simple 2D game library in Go</p>
2016-08-26 19:28:57 +02:00
</div></header>
<main><div class="container">
2018-10-06 07:43:41 +02:00
<p>Stable version: v1.7.4 / Development version: v1.8.0-alpha</p>
2016-08-28 00:26:03 +02:00
<h2 id="platforms">Platforms</h2>
2017-08-17 18:22:19 +02:00
<dl class="row">
<dt class="col-2 text-right">Desktops</dt>
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Windows">Windows</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/macOS">macOS</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/Linux">Linux</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/FreeBSD">FreeBSD</a></dd>
<dt class="col-2 text-right">Mobiles</dt>
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Android">Android</a>, <a href="https://github.com/hajimehoshi/ebiten/wiki/iOS">iOS</a></dd>
<dt class="col-2 text-right">Web browsers</dt>
2018-06-27 04:59:49 +02:00
<dd class="col-10">Chrome, Firefox, Safari and Edge (<a href="https://github.com/hajimehoshi/ebiten/wiki/GopherJS">GopherJS</a> and <a href="https://github.com/hajimehoshi/ebiten/wiki/WebAssembly">WebAssembly (Experimental)</a>)</dd>
2016-08-28 00:26:03 +02:00
</dl>
<p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p>
2016-08-26 19:28:57 +02:00
<h2 id="features">Features</h2>
2017-08-17 18:22:19 +02:00
<dl class="row">
<dt class="col-2 text-right">2D Graphics</dt>
2018-10-11 18:25:49 +02:00
<dd class="col-10">Geometry/Color matrix transformation, Various composition modes, Offscreen rendering, Fullscreen, Text rendering, Automatic batches, Automatic texture atlas</dd>
2017-08-17 18:22:19 +02:00
<dt class="col-2 text-right">Input</dt>
<dd class="col-10">Mouse, Keyboard, Gamepads, Touches</dd>
<dt class="col-2 text-right">Audio</dt>
<dd class="col-10">MP3, Ogg/Vorbis, WAV, PCM, Syncing with game progress</dd>
2016-08-28 00:20:34 +02:00
</dl>
2016-08-26 19:28:57 +02:00
<h2 id="examples">Examples</h2>
2018-01-31 20:34:38 +01:00
<h3>Games</h3>
<div class="row">
<div class="col-3">
<a href="./examples/2048.html"><img src="images/examples/2048.png" width="210" height="300" alt="Ebiten example: 2048" class="img-thumbnail"></a>
2018-01-31 20:34:38 +01:00
</div><div class="col-3">
<a href="./examples/blocks.html"><img src="images/examples/blocks.png" width="256" height="240" alt="Ebiten example: blocks" class="img-thumbnail"></a>
2018-04-08 13:54:39 +02:00
</div><div class="col-3">
<a href="./examples/flappy.html"><img src="images/examples/flappy.png" width="320" height="240" alt="Ebiten example: flappy" class="img-thumbnail"></a>
2018-01-31 20:34:38 +01:00
</div>
</div>
2018-01-30 17:18:33 +01:00
<h3>Graphics</h3>
2016-08-26 19:28:57 +02:00
<div class="row">
2017-08-17 18:22:19 +02:00
<div class="col-3">
<a href="./examples/airship.html"><img src="images/examples/airship.png" width="320" height="240" alt="Ebiten example: airship" class="img-thumbnail"></a>
2018-03-11 17:33:52 +01:00
</div><div class="col-3">
<a href="./examples/alphablending.html"><img src="images/examples/alphablending.png" width="320" height="240" alt="Ebiten example: alphablending" class="img-thumbnail"></a>
2018-10-10 18:39:47 +02:00
</div><div class="col-3">
<a href="./examples/animation.html"><img src="images/examples/animation.png" width="320" height="240" alt="Ebiten example: animation" class="img-thumbnail"></a>
2018-09-30 16:21:25 +02:00
</div><div class="col-3">
<a href="./examples/blur.html"><img src="images/examples/blur.png" width="320" height="240" alt="Ebiten example: blur" class="img-thumbnail"></a>
2018-02-14 02:38:26 +01:00
</div><div class="col-3">
2018-05-12 10:26:37 +02:00
<a href="./examples/drag.html"><img src="images/examples/drag.png" width="320" height="240" alt="Ebiten example: drag" class="img-thumbnail"></a>
</div><div class="col-3">
<a href="./examples/filter.html"><img src="images/examples/filter.png" width="320" height="240" alt="Ebiten example: filter" class="img-thumbnail"></a>
2018-01-31 20:34:38 +01:00
</div><div class="col-3">
<a href="./examples/flood.html"><img src="images/examples/flood.png" width="320" height="240" alt="Ebiten example: flood" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/font.html"><img src="images/examples/font.png" width="320" height="240" alt="Ebiten example: font" class="img-thumbnail"></a>
2018-01-28 13:49:24 +01:00
</div><div class="col-3">
<a href="./examples/highdpi.html"><img src="images/examples/highdpi.png" width="320" height="240" alt="Ebiten example: highdpi" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/hsv.html"><img src="images/examples/hsv.png" width="320" height="240" alt="Ebiten example: hsv" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/hue.html"><img src="images/examples/hue.png" width="320" height="240" alt="Ebiten example: hue" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/infinitescroll.html"><img src="images/examples/infinitescroll.png" width="320" height="240" alt="Ebiten example: infinitescroll" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/life.html"><img src="images/examples/life.png" width="320" height="240" alt="Ebiten example: life" class="img-thumbnail"></a>
2018-01-31 20:34:38 +01:00
</div><div class="col-3">
<a href="./examples/mandelbrot.html"><img src="images/examples/mandelbrot.png" width="320" height="320" alt="Ebiten example: mandelbrot" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/masking.html"><img src="images/examples/masking.png" width="320" height="240" alt="Ebiten example: masking" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/mosaic.html"><img src="images/examples/mosaic.png" width="320" height="240" alt="Ebiten example: mosaic" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/noise.html"><img src="images/examples/noise.png" width="320" height="240" alt="Ebiten example: noise" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/paint.html"><img src="images/examples/paint.png" width="320" height="240" alt="Ebiten example: paint" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/perspective.html"><img src="images/examples/perspective.png" width="320" height="240" alt="Ebiten example: perspective" class="img-thumbnail"></a>
2018-09-25 19:32:24 +02:00
</div><div class="col-3">
<a href="./examples/polygons.html"><img src="images/examples/polygons.png" width="320" height="240" alt="Ebiten example: polygons" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/rotate.html"><img src="images/examples/rotate.png" width="320" height="240" alt="Ebiten example: rotate" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/sprites.html"><img src="images/examples/sprites.png" width="320" height="240" alt="Ebiten example: sprites" class="img-thumbnail"></a>
2018-02-05 19:59:10 +01:00
</div><div class="col-3">
<a href="./examples/tiles.html"><img src="images/examples/tiles.png" width="240" height="240" alt="Ebiten example: tiles" class="img-thumbnail"></a>
2018-01-30 17:18:33 +01:00
</div>
</div>
<h3>Input</h3>
<div class="row">
<div class="col-3">
<a href="./examples/gamepad.html"><img src="images/examples/gamepad.png" width="320" height="240" alt="Ebiten example: gamepad" class="img-thumbnail"></a>
2018-01-30 17:18:33 +01:00
</div><div class="col-3">
<a href="./examples/keyboard.html"><img src="images/examples/keyboard.png" width="320" height="240" alt="Ebiten example: keyboard" class="img-thumbnail"></a>
2017-11-09 17:32:18 +01:00
</div><div class="col-3">
<a href="./examples/typewriter.html"><img src="images/examples/typewriter.png" width="320" height="240" alt="Ebiten example: typewriter" class="img-thumbnail"></a>
2018-09-30 16:21:25 +02:00
</div><div class="col-3">
<a href="./examples/wheel.html"><img src="images/examples/wheel.png" width="320" height="240" alt="Ebiten example: wheel" class="img-thumbnail"></a>
2018-01-30 17:18:33 +01:00
</div>
</div>
<h3>Audio</h3>
<div class="row">
<div class="col-3">
<a href="./examples/audio.html"><img src="images/examples/audio.png" width="320" height="240" alt="Ebiten example: audio" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/piano.html"><img src="images/examples/piano.png" width="320" height="240" alt="Ebiten example: piano" class="img-thumbnail"></a>
2017-08-17 18:22:19 +02:00
</div><div class="col-3">
<a href="./examples/sinewave.html"><img src="images/examples/sinewave.png" width="320" height="240" alt="Ebiten example: sinewave" class="img-thumbnail"></a>
2016-08-26 19:28:57 +02:00
</div>
</div>
2018-01-30 17:18:33 +01:00
2016-08-27 17:58:27 +02:00
<p><a href="https://blog.golang.org/go-programming-language-turns-two">The Gopher photographs by Chris Nokleberg</a> are licensed under <a href="https://creativecommons.org/licenses/by/3.0/">the Creative Commons 3.0 Attributions License</a>.</p>
2016-08-26 19:28:57 +02:00
2017-08-18 16:26:17 +02:00
<h3>Execute the examples</h3>
<div class="card"><pre class="card-body"><code class="language-bash">go get github.com/hajimehoshi/ebiten/...
2017-08-17 18:22:19 +02:00
cd $GOPATH/src/github.com/hajimehoshi/ebiten/examples
2017-08-18 16:26:17 +02:00
go run -tags=example rotate/main.go</code></pre></div>
2016-10-15 18:14:22 +02:00
<p>Note that you need to add <code>-tags=example</code> to run examples.</p>
2016-08-26 16:33:36 +02:00
<h2 id="projects-with-ebiten">Projects with Ebiten</h2>
<div class="row">
2018-01-23 19:36:51 +01:00
<div class="col-3">
<a href="https://github.com/hajimehoshi/go-inovation"><img src="images/projects/inovation.png" width="1024" height="500" alt="Inovation 2007" class="img-thumbnail"></a>
</div>
<div class="col-3">
<a href="http://blockbros.net/tsugunai/"><img src="images/projects/clock_of_atonement.png" width="480" height="480" alt="Clock of Atonement" class="img-thumbnail"></a>
</div>
<div class="col-3">
<a href="http://blockbros.net/bluebird/"><img src="images/projects/bluebird_of_happiness.png" width="540" height="540" alt="Bluebird of Happiness" class="img-thumbnail"></a>
</div>
</div>
2018-01-06 14:09:04 +01:00
<p><a href="https://github.com/hajimehoshi/ebiten/wiki/Works">Find more nice works with Ebiten!</a></p>
2016-08-26 19:28:57 +02:00
<h2 id="getting-started">Getting Started</h2>
2014-12-27 16:26:33 +01:00
2016-08-26 19:28:57 +02:00
<p>Let's build a simple "Hello world!" game to get started with Ebiten.
2016-06-23 05:16:27 +02:00
First create a new directory (<code>mkdir hello_world</code>), and change
into it (<code>cd hello_world</code>). Type the following code into
the <code>main.go</code> file:</p>
2017-08-18 16:26:17 +02:00
<div class="card"><pre class="card-body"><code class="language-go">package main
2016-06-23 05:16:27 +02:00
import (
2016-08-26 22:36:52 +02:00
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/ebitenutil"
2016-06-23 05:16:27 +02:00
)
func update(screen *ebiten.Image) error {
ebitenutil.DebugPrint(screen, "Hello world!")
2016-08-26 22:36:52 +02:00
return nil
2016-06-23 05:16:27 +02:00
}
func main() {
2016-08-26 22:36:52 +02:00
ebiten.Run(update, 320, 240, 2, "Hello world!")
2016-06-23 05:16:27 +02:00
}
2017-08-18 16:26:17 +02:00
</code></pre></div>
2016-06-23 05:16:27 +02:00
2016-08-26 19:28:57 +02:00
<p>Run the <code>go run</code> command to start the
2016-06-23 05:16:27 +02:00
game. There you have it, your first Ebiten game!</p>
2016-08-26 19:28:57 +02:00
</div></main>
2015-01-08 15:45:30 +01:00
2016-08-26 19:28:57 +02:00
<footer><div class="container">
<p>© 2013 Hajime Hoshi</p>
2016-08-28 00:10:41 +02:00
<p>Code is licensed under <a href="https://github.com/hajimehoshi/ebiten/blob/master/LICENSE">the Apache License 2.0</a>.</p>
2016-08-26 19:28:57 +02:00
<p>The content of this page is licensed under <a href="https://creativecommons.org/licenses/by/4.0/">the Creative Commons Attribution 4.0 License</a>.</p>
</div></footer>
2016-08-27 07:00:06 +02:00
2016-08-27 17:48:15 +02:00
<script src="./scripts/highlight.pack.js"></script>
2016-08-27 07:00:06 +02:00
<script>hljs.initHighlightingOnLoad();</script>