mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
105 lines
4.1 KiB
HTML
105 lines
4.1 KiB
HTML
<!DOCTYPE html>
|
|
<meta name="description" content="Ebiten - A simple SNES-like 2D game library in Go">
|
|
<link rel="shortcut icon" href="./favicon.png" type="image/png">
|
|
<link rel="icon" href="./favicon.png" type="image/png">
|
|
<title>Ebiten - A simple SNES-like 2D game library in Go</title>
|
|
<link rel="stylesheet" href="/stylesheets/bootstrap.min.css">
|
|
<link rel="stylesheet" href="/stylesheets/ebiten.css">
|
|
|
|
<header class="navbar"><div class="container">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand" href="/">Ebiten</a>
|
|
</div>
|
|
<nav class="collapse navbar-collapse">
|
|
<ul class="nav navbar-nav">
|
|
<li><a href="#features">Features</a></li>
|
|
<li><a href="#examples">Examples</a></li>
|
|
<li><a href="#getting-started">Getting Started</a></li>
|
|
</ul>
|
|
<ul class="nav navbar-nav navbar-right">
|
|
<li><a href="https://github.com/hajimehoshi/ebiten">GitHub</a></li>
|
|
<li><a href="http://godoc.org/github.com/hajimehoshi/ebiten">GoDoc</a></li>
|
|
<li><a href="https://github.com/hajimehoshi/ebiten/wiki">Wiki</a>
|
|
</ul>
|
|
</nav>
|
|
</div></header>
|
|
|
|
<main><div class="container">
|
|
<h1>Ebiten <small>(海老天)</small></h1>
|
|
<p class="lead">A simple SNES-like 2D game library in Go</p>
|
|
<p>Stable version: v{{.StableVersion}} / Development version: v{{.DevVersion}}</p>
|
|
<ul>
|
|
<li>Works on
|
|
<ul>
|
|
<li><a href="https://github.com/hajimehoshi/ebiten/wiki/Web-Browsers">Web browsers</a> (powered by <a href="http://gopherjs.org/">GopherJS</a>)
|
|
<ul>
|
|
<li>Supported browsers: Chrome and Firefox on desktops</li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="https://github.com/hajimehoshi/ebiten/wiki/Windows">Windows</a></li>
|
|
<li><a href="https://github.com/hajimehoshi/ebiten/wiki/Mac-OS-X">Mac OS X</a></li>
|
|
<li><a href="https://github.com/hajimehoshi/ebiten/wiki/Linux">Linux</a></li>
|
|
<li><a href="https://github.com/hajimehoshi/ebiten/wiki/Android">Android</a></li>
|
|
<li><a href="https://github.com/hajimehoshi/ebiten/wiki/iOS">iOS</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<h2 id="features">Features</h2>
|
|
<ul>
|
|
<li>2D Graphics</li>
|
|
<li>Input (Mouse, Keyboard, Gamepad)</li>
|
|
<li>Audio (Ogg/Vorbis, WAV, and PCM)</li>
|
|
</ul>
|
|
|
|
<h2 id="examples">Examples</h2>
|
|
<div class="row">
|
|
{{range .Examples -}}
|
|
<div class="col-md-3">
|
|
<a class="thumbnail" scrolling="no" href="examples/{{.Name}}.html"><img src="images/examples/{{.Name}}.png" width="{{.ThumbWidth}}" height="{{.ThumbHeight}}" alt="Ebiten example: {{.Name}}" class="example"></a>
|
|
</div>
|
|
{{- end}}
|
|
</div>
|
|
|
|
<h3>Execute the examples</h2>
|
|
<pre><code>:; go get github.com/hajimehoshi/ebiten
|
|
:; cd $GOPATH/src/github.com/hajimehoshi/ebiten/examples
|
|
:; go run -tags example rotate/main.go</code></pre>
|
|
<p>Note that you need to specify <code>example</code> tag.</p>
|
|
|
|
<h2 id="getting-started">Getting Started</h2>
|
|
|
|
<p>Let's build a simple "Hello world!" game to get started with Ebiten.
|
|
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>
|
|
|
|
<pre><code>package main
|
|
|
|
import (
|
|
"github.com/hajimehoshi/ebiten"
|
|
"github.com/hajimehoshi/ebiten/ebitenutil"
|
|
)
|
|
|
|
func update(screen *ebiten.Image) error {
|
|
ebitenutil.DebugPrint(screen, "Hello world!")
|
|
return nil
|
|
}
|
|
|
|
func main() {
|
|
ebiten.Run(update, 320, 240, 2, "Hello world!")
|
|
}
|
|
</code></pre>
|
|
|
|
<p>Run the <code>go run</code> command to start the
|
|
game. There you have it, your first Ebiten game!</p>
|
|
|
|
</div></main>
|
|
|
|
<footer><div class="container">
|
|
<p>{{.Copyright}}</p>
|
|
<p>Code is licensed under <a href="https://github.com/hajimehoshi/ebiten/blob/master/LICENSE">Apache License 2.0</a>.</p>
|
|
<p><a href="http://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>
|
|
<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>
|