diff --git a/docs/examples/_resources/images/arcadefont.png b/docs/examples/_resources/images/arcadefont.png deleted file mode 100644 index fa0e52604..000000000 Binary files a/docs/examples/_resources/images/arcadefont.png and /dev/null differ diff --git a/docs/examples/_resources/images/platformer/background.png b/docs/examples/_resources/images/platformer/background.png new file mode 100644 index 000000000..d821a9bcb Binary files /dev/null and b/docs/examples/_resources/images/platformer/background.png differ diff --git a/docs/examples/_resources/images/platformer/left.png b/docs/examples/_resources/images/platformer/left.png new file mode 100644 index 000000000..7ebc66ddf Binary files /dev/null and b/docs/examples/_resources/images/platformer/left.png differ diff --git a/docs/examples/_resources/images/platformer/mainchar.png b/docs/examples/_resources/images/platformer/mainchar.png new file mode 100644 index 000000000..240067398 Binary files /dev/null and b/docs/examples/_resources/images/platformer/mainchar.png differ diff --git a/docs/examples/_resources/images/platformer/right.png b/docs/examples/_resources/images/platformer/right.png new file mode 100644 index 000000000..2936b1087 Binary files /dev/null and b/docs/examples/_resources/images/platformer/right.png differ diff --git a/docs/examples/_resources/images/ui.png b/docs/examples/_resources/images/ui.png new file mode 100644 index 000000000..60cbdd9ec Binary files /dev/null and b/docs/examples/_resources/images/ui.png differ diff --git a/docs/examples/alphablending.html b/docs/examples/alphablending.html index 218e43ea4..e46ee5dd1 100644 --- a/docs/examples/alphablending.html +++ b/docs/examples/alphablending.html @@ -78,7 +78,7 @@ func update(screen *ebiten.Image) error { func main() { var err error - ebitenImage, _, err = ebitenutil.NewImageFromFile("_resources/images/ebiten.png", ebiten.FilterNearest) + ebitenImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "ebiten.png"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/audio.html b/docs/examples/audio.html index 23a2f90e4..2fed0115b 100644 --- a/docs/examples/audio.html +++ b/docs/examples/audio.html @@ -118,11 +118,11 @@ func playerBarRect() (x, y, w, h int) { func NewPlayer(audioContext *audio.Context) (*Player, error) { const bytesPerSample = 4 // TODO: This should be defined in audio package - wavF, err := ebitenutil.OpenFile("_resources/audio/jab.wav") + wavF, err := ebitenutil.OpenFile(ebitenutil.JoinStringsIntoFilePath("_resources", "audio", "jab.wav")) if err != nil { return nil, err } - mp3F, err := ebitenutil.OpenFile("_resources/audio/classic.mp3") + mp3F, err := ebitenutil.OpenFile(ebitenutil.JoinStringsIntoFilePath("_resources", "audio", "classic.mp3")) if err != nil { return nil, err } @@ -184,9 +184,6 @@ func (p *Player) update() error { b := ebiten.IsRunnableInBackground() ebiten.SetRunnableInBackground(!b) } - if err := p.audioContext.Update(); err != nil { - return err - } return nil } diff --git a/docs/examples/hsv.html b/docs/examples/hsv.html index 06d6bdaff..d9302a291 100644 --- a/docs/examples/hsv.html +++ b/docs/examples/hsv.html @@ -131,7 +131,7 @@ Inverted: %s [I]`, hue, saturation, value, msgInverted) func main() { var err error - gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest) + gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/hue.html b/docs/examples/hue.html index dc094dbd7..ee8fba710 100644 --- a/docs/examples/hue.html +++ b/docs/examples/hue.html @@ -65,7 +65,7 @@ func update(screen *ebiten.Image) error { func main() { var err error - gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest) + gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/infinitescroll.html b/docs/examples/infinitescroll.html index 31b1f8b68..8fe7e54bf 100644 --- a/docs/examples/infinitescroll.html +++ b/docs/examples/infinitescroll.html @@ -116,7 +116,7 @@ func update(screen *ebiten.Image) error { func main() { var err error - bgImage, _, err = ebitenutil.NewImageFromFile("_resources/images/tile.png", ebiten.FilterNearest) + bgImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "tile.png"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/keyboard.html b/docs/examples/keyboard.html index aea502617..a176fc86f 100644 --- a/docs/examples/keyboard.html +++ b/docs/examples/keyboard.html @@ -49,7 +49,7 @@ var keyboardImage *ebiten.Image func init() { var err error - keyboardImage, _, err = ebitenutil.NewImageFromFile("_resources/images/keyboard/keyboard.png", ebiten.FilterNearest) + keyboardImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "keyboard", "keyboard.png"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/masking.html b/docs/examples/masking.html index ffe56dc4e..35ba52cef 100644 --- a/docs/examples/masking.html +++ b/docs/examples/masking.html @@ -115,11 +115,11 @@ func min(a, b int) int { func main() { var err error - gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest) + gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } - fiveyearsImage, _, err = ebitenutil.NewImageFromFile("_resources/images/fiveyears.jpg", ebiten.FilterNearest) + fiveyearsImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "fiveyears.jpg"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/mosaic.html b/docs/examples/mosaic.html index 5a57e7f2a..41846f290 100644 --- a/docs/examples/mosaic.html +++ b/docs/examples/mosaic.html @@ -66,7 +66,7 @@ func update(screen *ebiten.Image) error { func main() { var err error - gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest) + gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/perspective.html b/docs/examples/perspective.html index 2eb9c6130..3c43e05d5 100644 --- a/docs/examples/perspective.html +++ b/docs/examples/perspective.html @@ -73,7 +73,7 @@ func update(screen *ebiten.Image) error { func main() { var err error - gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest) + gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/piano.html b/docs/examples/piano.html index 0a4c501c9..29d4dd131 100644 --- a/docs/examples/piano.html +++ b/docs/examples/piano.html @@ -198,9 +198,6 @@ func update(screen *ebiten.Image) error { } addNote(220*math.Exp2(float64(i-1)/12.0), 1.0) } - if err := audioContext.Update(); err != nil { - return err - } if ebiten.IsRunningSlowly() { return nil } diff --git a/docs/examples/rotate.html b/docs/examples/rotate.html index 0cda9113f..84769e68d 100644 --- a/docs/examples/rotate.html +++ b/docs/examples/rotate.html @@ -66,7 +66,7 @@ func update(screen *ebiten.Image) error { func main() { var err error - gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest) + gophersImage, _, err = ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "gophers.jpg"), ebiten.FilterNearest) if err != nil { log.Fatal(err) } diff --git a/docs/examples/sprites.html b/docs/examples/sprites.html index 19280d029..0b47b5408 100644 --- a/docs/examples/sprites.html +++ b/docs/examples/sprites.html @@ -141,7 +141,7 @@ Press <- or -> to change the number of sprites`, ebiten.CurrentFPS(), spri func main() { var err error - img, _, err := ebitenutil.NewImageFromFile("_resources/images/ebiten.png", ebiten.FilterNearest) + img, _, err := ebitenutil.NewImageFromFile(ebitenutil.JoinStringsIntoFilePath("_resources", "images", "ebiten.png"), ebiten.FilterNearest) if err != nil { log.Fatal(err) }