Invalid set index 'texure' (on base: 'Sprite') with value of type 'StreamTexture'.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rulu246

currently i create a player information view with the icon of platform it’s on, but Sprite is unable to load it’s icon file.

var os = Sprite.new()

$player_info.add_child(os)

match OS.get_name():
	"Android":
		os.texure = load("res://ui/icons/os/android.png")
	"Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD", "X11":
		os.texure = load("res://ui/icons/os/linux.png")
	"UWP":
		os.texture = load("res://ui/icons/os/windows.png")
	"Windows":
		os.texture = load("res://ui/icons/os/windows-11.png")
:bust_in_silhouette: Reply From: spaceyjase

Perhaps you mean to use an ImageTexture?

There’s an example in the docs too:

var texture = ImageTexture.new()
var image = Image.new()
image.load("res://icon.png")
texture.create_from_image(image)
$Sprite.texture = texture