examples: Move images to _resources/images

This commit is contained in:
Hajime Hoshi 2016-02-21 01:35:45 +09:00
parent 408444842a
commit 5f8ef3cf52
19 changed files with 15 additions and 14 deletions

View File

Before

Width:  |  Height:  |  Size: 1008 B

After

Width:  |  Height:  |  Size: 1008 B

View File

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 138 B

View File

Before

Width:  |  Height:  |  Size: 165 B

After

Width:  |  Height:  |  Size: 165 B

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -72,7 +72,7 @@ func update(screen *ebiten.Image) error {
func main() { func main() {
var err error var err error
ebitenImage, _, err = ebitenutil.NewImageFromFile("images/ebiten.png", ebiten.FilterNearest) ebitenImage, _, err = ebitenutil.NewImageFromFile("_resources/images/ebiten.png", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -76,7 +76,7 @@ func init() {
} }
imageEmpty.Fill(color.White) imageEmpty.Fill(color.White)
// Background // Background
imageGameBG, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterLinear) imageGameBG, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterLinear)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -23,7 +23,7 @@ var imageBlocks *ebiten.Image
func init() { func init() {
var err error var err error
imageBlocks, _, err = ebitenutil.NewImageFromFile("images/blocks/blocks.png", ebiten.FilterNearest) imageBlocks, _, err = ebitenutil.NewImageFromFile("_resources/images/blocks/blocks.png", ebiten.FilterNearest)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -26,7 +26,7 @@ var imageBackground *ebiten.Image
func init() { func init() {
var err error var err error
imageBackground, _, err = ebitenutil.NewImageFromFile("images/blocks/background.png", ebiten.FilterNearest) imageBackground, _, err = ebitenutil.NewImageFromFile("_resources/images/blocks/background.png", ebiten.FilterNearest)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -15,13 +15,14 @@
package common package common
import ( import (
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/ebitenutil"
"image/color" "image/color"
"math" "math"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strings" "strings"
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/ebitenutil"
) )
var ( var (
@ -49,7 +50,7 @@ func init() {
path = filepath.Dir(path) path = filepath.Dir(path)
dir = filepath.Join(path, "..") dir = filepath.Join(path, "..")
} }
arcadeFontPath := filepath.Join(dir, "images", "arcadefont.png") arcadeFontPath := filepath.Join(dir, "_resources", "images", "arcadefont.png")
arcadeFontImage, _, err := ebitenutil.NewImageFromFile(arcadeFontPath, ebiten.FilterNearest) arcadeFontImage, _, err := ebitenutil.NewImageFromFile(arcadeFontPath, ebiten.FilterNearest)
if err != nil { if err != nil {

View File

@ -47,7 +47,7 @@ func update(screen *ebiten.Image) error {
func main() { func main() {
var err error var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest) gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -32,7 +32,7 @@ var keyboardImage *ebiten.Image
func init() { func init() {
var err error var err error
keyboardImage, _, err = ebitenutil.NewImageFromFile("images/keyboard/keyboard.png", ebiten.FilterNearest) keyboardImage, _, err = ebitenutil.NewImageFromFile("_resources/images/keyboard/keyboard.png", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -46,7 +46,7 @@ func update(screen *ebiten.Image) error {
func main() { func main() {
var err error var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest) gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -66,7 +66,7 @@ func update(screen *ebiten.Image) error {
func main() { func main() {
var err error var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest) gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -48,7 +48,7 @@ func update(screen *ebiten.Image) error {
func main() { func main() {
var err error var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest) gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -133,7 +133,7 @@ Press <- or -> to change the number of sprites`, ebiten.CurrentFPS(), sprites.Le
func main() { func main() {
var err error var err error
ebitenImage, _, err = ebitenutil.NewImageFromFile("images/ebiten.png", ebiten.FilterNearest) ebitenImage, _, err = ebitenutil.NewImageFromFile("_resources/images/ebiten.png", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -102,7 +102,7 @@ FPS: %0.2f`, x, y, ebiten.CurrentFPS())
func main() { func main() {
var err error var err error
gophersImage, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest) gophersImage, _, err = ebitenutil.NewImageFromFile("_resources/images/gophers.jpg", ebiten.FilterNearest)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }