load custom artwork

This commit is contained in:
Fabien Freling 2020-06-10 17:15:33 +02:00
parent 8cc55513b7
commit 5e1e27b2cb
10 changed files with 225 additions and 47 deletions

9
src/Utils.gd Normal file
View file

@ -0,0 +1,9 @@
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