10 lines
258 B
GDScript
10 lines
258 B
GDScript
|
static func load_texture_from_path(path: String) -> Texture:
|
||
|
var img = Image.new()
|
||
|
var texture = ImageTexture.new()
|
||
|
if img.load(path) != OK:
|
||
|
print_debug("Cannot load image at path: ", path)
|
||
|
return null
|
||
|
texture.create_from_image(img)
|
||
|
return texture
|
||
|
|