1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ebitenでのアイコン設定

Last updated at Posted at 2021-09-22

 Ebitenでゲームを作ってますが、ウインドウのアイコン設定でハマったのでqiitaでソース残しておきます

import (
	"image"
	"image/png"
	"os"

	"github.com/hajimehoshi/ebiten/v2"
)

 golangの方のimageを使っているので、いつもの

	_ "image/png"

では無いです

func iconSet() {
	p, err := os.Open("icon.png")
	if err != nil {
		panic(err)
	}
	defer p.Close()
	
	img, err := png.Decode(p)
	if err != nil {
		panic(err)
	}
	
	ebiten.SetWindowIcon([]image.Image{img})
}

 Go言語って、配列の設定でメゾッドへ送れたんだな…

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?