Beispiel #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)
}
Beispiel #2
0
func getDefaultFont() []byte {
	return util.Base64ToBytes(defaultFontData)
}
Beispiel #3
0
func loadImageAsset(key, data string, uiAssets ui.HtmlAssets) {
	img, _ := assets.DecodeImage(bytes.NewBuffer(util.Base64ToBytes(data)))
	uiAssets.AddImage(key, img)
}