AddinBugfixing Image loading
This commit is contained in:
parent
ef53ed543f
commit
0b848f62f6
2 changed files with 5 additions and 5 deletions
|
|
@ -62,11 +62,10 @@ static func _load_texture_from_path(path: String) -> Texture2D:
|
||||||
if path.begins_with("res://"):
|
if path.begins_with("res://"):
|
||||||
return load(path) as Texture2D
|
return load(path) as Texture2D
|
||||||
|
|
||||||
# For filesystem paths, load the image and create a texture
|
# For filesystem paths, load the image using static method
|
||||||
var image: Image = Image.new()
|
var image: Image = Image.load_from_file(path)
|
||||||
var error: Error = image.load_from_file(path)
|
if image == null:
|
||||||
if error != OK:
|
push_error("TileSetHelper: Failed to load image from file: %s" % path)
|
||||||
push_error("TileSetHelper: Failed to load image from file: %s (Error: %d)" % [path, error])
|
|
||||||
return null
|
return null
|
||||||
|
|
||||||
var texture: ImageTexture = ImageTexture.create_from_image(image)
|
var texture: ImageTexture = ImageTexture.create_from_image(image)
|
||||||
|
|
|
||||||
1
hexmapper/scenes/MainMap/map/tile_set_helper.gd.uid
Normal file
1
hexmapper/scenes/MainMap/map/tile_set_helper.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dy3opdq7yokuc
|
||||||
Loading…
Add table
Add a link
Reference in a new issue