示例#1
0
func (e *Editor) initSelectSprite() {
	img, _ := assets.DecodeImage(bytes.NewBuffer(util.Base64ToBytes(GeometryIconData)))
	mat := renderer.NewMaterial(renderer.NewTexture("diffuseMap", img, false))
	selectSprite := effects.CreateSprite(1, 1, 1, mat)
	spriteNode := renderer.NewNode()
	spriteNode.RendererParams = &renderer.RendererParams{Unlit: true}
	spriteNode.Add(selectSprite)
	e.selectSprite = selectSprite
	e.gameEngine.AddSpatialTransparent(spriteNode)
}
示例#2
0
文件: ui.go 项目: walesey/go-engine
func loadImageAsset(key, data string, uiAssets ui.HtmlAssets) {
	img, _ := assets.DecodeImage(bytes.NewBuffer(util.Base64ToBytes(data)))
	uiAssets.AddImage(key, img)
}