mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Rename NewTextureFromFile -> NewImageFromFile
This commit is contained in:
parent
3a9a7fed87
commit
d774c19581
@ -22,7 +22,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func NewTextureFromFile(path string, filter ebiten.Filter) (*ebiten.Image, image.Image, error) {
|
||||
func NewImageFromFile(path string, filter ebiten.Filter) (*ebiten.Image, image.Image, error) {
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
@ -72,7 +72,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error {
|
||||
func main() {
|
||||
g := new(Game)
|
||||
var err error
|
||||
g.ebitenTexture, _, err = ebitenutil.NewTextureFromFile("images/ebiten.png", ebiten.FilterNearest)
|
||||
g.ebitenTexture, _, err = ebitenutil.NewImageFromFile("images/ebiten.png", ebiten.FilterNearest)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error {
|
||||
func main() {
|
||||
g := new(Game)
|
||||
var err error
|
||||
g.gophersTexture, _, err = ebitenutil.NewTextureFromFile("images/gophers.jpg", ebiten.FilterNearest)
|
||||
g.gophersTexture, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error {
|
||||
func main() {
|
||||
g := new(Game)
|
||||
var err error
|
||||
g.gophersTexture, _, err = ebitenutil.NewTextureFromFile("images/gophers.jpg", ebiten.FilterNearest)
|
||||
g.gophersTexture, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ func (g *Game) Update(r *ebiten.RenderTarget) error {
|
||||
func main() {
|
||||
g := new(Game)
|
||||
var err error
|
||||
g.gophersTexture, _, err = ebitenutil.NewTextureFromFile("images/gophers.jpg", ebiten.FilterNearest)
|
||||
g.gophersTexture, _, err = ebitenutil.NewImageFromFile("images/gophers.jpg", ebiten.FilterNearest)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user