mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
docs: Update (playground URL)
This commit is contained in:
parent
a3bf8ebf83
commit
4c906dfbef
@ -17,7 +17,7 @@ Website: https://hajimehoshi.github.io/ebiten/
|
||||
* [Android](https://github.com/hajimehoshi/ebiten/wiki/Android)
|
||||
* [iOS](https://github.com/hajimehoshi/ebiten/wiki/iOS)
|
||||
* [Web browsers (Chrome, Firefox, Safari and Edge on desktops)](https://github.com/hajimehoshi/ebiten/wiki/Web-Browsers) (powered by [GopherJS](http://gopherjs.org/))
|
||||
* [jsgo.io Playground by Dave Brophy](https://goo.gl/Qtz8ur)
|
||||
* [jsgo.io Playground by Dave Brophy](https://jsgo.io/dave/jsgo/playground#9b4d11ce563df53cb7dff937baa707c3fd41310c)
|
||||
|
||||
Note: Gamepad and keyboard are not available on Android/iOS.
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
<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>
|
||||
<li class="nav-item"><a class="nav-link" href="https://github.com/hajimehoshi/ebiten/wiki">Wiki</a>
|
||||
<li class="nav-item"><a class="nav-link" href="https://goo.gl/Qtz8ur">Playground (jsgo.io)</a>
|
||||
<li class="nav-item"><a class="nav-link" href="https://jsgo.io/dave/jsgo/playground#9b4d11ce563df53cb7dff937baa707c3fd41310c">Playground (jsgo.io)</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div></nav>
|
||||
@ -45,7 +45,7 @@
|
||||
<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>
|
||||
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Web-Browsers">Chrome, Firefox, Safari and Edge on desktops</a> (powered by <a href="https://github.com/gopherjs/gopherjs">GopherJS</a>), <a href="https://goo.gl/Qtz8ur">jsgo.io Playground by Dave Brophy</a></dd>
|
||||
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Web-Browsers">Chrome, Firefox, Safari and Edge on desktops</a> (powered by <a href="https://github.com/gopherjs/gopherjs">GopherJS</a>), <a href="https://jsgo.io/dave/jsgo/playground#9b4d11ce563df53cb7dff937baa707c3fd41310c">jsgo.io Playground by Dave Brophy</a></dd>
|
||||
</dl>
|
||||
<p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p>
|
||||
|
||||
|
@ -33,10 +33,8 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"image"
|
||||
_ "image/jpeg"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
"github.com/hajimehoshi/ebiten/ebitenutil"
|
||||
@ -55,23 +53,11 @@ func init() {
|
||||
|
||||
// Load the image asynchronously.
|
||||
go func() {
|
||||
res, err := http.Get(url)
|
||||
img, err := ebitenutil.NewImageFromURL(url)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
||||
img, _, err := image.Decode(res.Body)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
eimg, err := ebiten.NewImageFromImage(img, ebiten.FilterDefault)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
highDPIImageCh <- eimg
|
||||
highDPIImageCh <- img
|
||||
close(highDPIImageCh)
|
||||
}()
|
||||
}
|
||||
|
@ -34,7 +34,6 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"math"
|
||||
|
||||
@ -88,23 +87,6 @@ func (s *stream) Read(data []byte) (int, error) {
|
||||
return len(data), nil
|
||||
}
|
||||
|
||||
// Seek is io.Seeker's Seek.
|
||||
//
|
||||
// whence must be io.SeekStart or io.SeekCurrent.
|
||||
func (s *stream) Seek(offset int64, whence int) (int64, error) {
|
||||
const length = sampleRate / frequency
|
||||
switch whence {
|
||||
case io.SeekStart:
|
||||
s.position = offset
|
||||
case io.SeekCurrent:
|
||||
s.position += offset
|
||||
default:
|
||||
return 0, errors.New("whence must be io.SeekStart or io.SeekCurrent")
|
||||
}
|
||||
s.position %= length * 4
|
||||
return s.position, nil
|
||||
}
|
||||
|
||||
// Close is io.Closer's Close.
|
||||
func (s *stream) Close() error {
|
||||
return nil
|
||||
|
@ -25,7 +25,7 @@
|
||||
<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>
|
||||
<li class="nav-item"><a class="nav-link" href="https://github.com/hajimehoshi/ebiten/wiki">Wiki</a>
|
||||
<li class="nav-item"><a class="nav-link" href="https://goo.gl/Qtz8ur">Playground (jsgo.io)</a>
|
||||
<li class="nav-item"><a class="nav-link" href="https://jsgo.io/dave/jsgo/playground#9b4d11ce563df53cb7dff937baa707c3fd41310c">Playground (jsgo.io)</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div></nav>
|
||||
@ -45,7 +45,7 @@
|
||||
<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>
|
||||
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Web-Browsers">Chrome, Firefox, Safari and Edge on desktops</a> (powered by <a href="https://github.com/gopherjs/gopherjs">GopherJS</a>), <a href="https://goo.gl/Qtz8ur">jsgo.io Playground by Dave Brophy</a></dd>
|
||||
<dd class="col-10"><a href="https://github.com/hajimehoshi/ebiten/wiki/Web-Browsers">Chrome, Firefox, Safari and Edge on desktops</a> (powered by <a href="https://github.com/gopherjs/gopherjs">GopherJS</a>), <a href="https://jsgo.io/dave/jsgo/playground#9b4d11ce563df53cb7dff937baa707c3fd41310c">jsgo.io Playground by Dave Brophy</a></dd>
|
||||
</dl>
|
||||
<p><small>Note: Gamepads and keyboard are not available on Android/iOS.</small></p>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user