Updated Installation (markdown)

Hajime Hoshi 2019-03-05 00:03:03 +09:00
parent 8de471c939
commit 6d8fd7379b

@ -13,7 +13,7 @@ go get github.com/gopherjs/gopherjs
go get github.com/gopherjs/gopherwasm/js go get github.com/gopherjs/gopherwasm/js
``` ```
# Modules (Go 1.11 and later) # Modules
As of Go 1.11, modules are introduced. You can work with Ebiten without GOPATH environment variable. If you want to use Ebiten with modules, execute these commands with Go 1.11: As of Go 1.11, modules are introduced. You can work with Ebiten without GOPATH environment variable. If you want to use Ebiten with modules, execute these commands with Go 1.11:
@ -31,3 +31,32 @@ go mod init example.com/m
# `go run` installs related libraries automatically. # `go run` installs related libraries automatically.
go run . go run .
``` ```
# Run examples
Let's execute an example to check installation finished correctly.
## Without modules
On POSIX:
```
cd $HOME/go/src/github.com/hajimehoshi/ebiten
go run -tags=example ./examples/rotate
```
On Windows:
```
cd %HOME%\go\src\github.com\hajimehoshi\ebiten
go run -tags=example ./examples/rotate
```
## With modules
```
mkdir test
go mod init example.com/m
go get github.com/hajimehoshi/ebiten
go run -tags=example github.com/hajimehoshi/ebiten/rotate/main.go
```