How would one go about adding a texture in GDScript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Duskitty
:warning: Old Version Published before Godot 3 was released.

So currently im trying to change the mouse cursor, and i found a way said thing but it says i need to do the texture path, how would i do this? i remembertrying to do this before but couldnt figure it out

Input.set_custom_mouse_cursor("res://icon.png")

Apparently this is wrong, So how about would i get the path if it says “Error converting string to object”

void	set_custom_mouse_cursor ( Texture image, Vector2 hotspot=Vector2(0,0) )

That’s what it is if it’s any help so you dont have to look up the thing

:bust_in_silhouette: Reply From: volzhs

load("res://icon.png") or preload("res://icon.png") will return Texture

Thanks for the help ^^

The_Duskitty | 2016-03-10 13:00