mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
docs: Update
This commit is contained in:
parent
407cc6a0e2
commit
a76d564147
Binary file not shown.
Before Width: | Height: | Size: 1008 B |
BIN
docs/examples/_resources/images/platformer/background.png
Normal file
BIN
docs/examples/_resources/images/platformer/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 96 KiB |
BIN
docs/examples/_resources/images/platformer/left.png
Normal file
BIN
docs/examples/_resources/images/platformer/left.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
BIN
docs/examples/_resources/images/platformer/mainchar.png
Normal file
BIN
docs/examples/_resources/images/platformer/mainchar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
BIN
docs/examples/_resources/images/platformer/right.png
Normal file
BIN
docs/examples/_resources/images/platformer/right.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
BIN
docs/examples/_resources/images/ui.png
Normal file
BIN
docs/examples/_resources/images/ui.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 599 B |
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user