mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 09:09:47 +00:00
Do not add an empty tile in the tilesets when loading a pxo file
This commit is contained in:
parent
e5c7d46997
commit
65e907e1d2
|
@ -352,7 +352,7 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces
|
||||||
if dict.has("tilesets"):
|
if dict.has("tilesets"):
|
||||||
for saved_tileset in dict["tilesets"]:
|
for saved_tileset in dict["tilesets"]:
|
||||||
var tile_size = str_to_var("Vector2i" + saved_tileset.get("tile_size"))
|
var tile_size = str_to_var("Vector2i" + saved_tileset.get("tile_size"))
|
||||||
var tileset := TileSetCustom.new(tile_size)
|
var tileset := TileSetCustom.new(tile_size, "", false)
|
||||||
tileset.deserialize(saved_tileset)
|
tileset.deserialize(saved_tileset)
|
||||||
tilesets.append(tileset)
|
tilesets.append(tileset)
|
||||||
if dict.has("frames") and dict.has("layers"):
|
if dict.has("frames") and dict.has("layers"):
|
||||||
|
|
|
@ -39,11 +39,12 @@ class Tile:
|
||||||
return times_used <= 0
|
return times_used <= 0
|
||||||
|
|
||||||
|
|
||||||
func _init(_tile_size: Vector2i, _name := "") -> void:
|
func _init(_tile_size: Vector2i, _name := "", add_empty_tile := true) -> void:
|
||||||
tile_size = _tile_size
|
tile_size = _tile_size
|
||||||
name = _name
|
name = _name
|
||||||
var empty_image := Image.create_empty(tile_size.x, tile_size.y, false, Image.FORMAT_RGBA8)
|
if add_empty_tile:
|
||||||
tiles.append(Tile.new(empty_image))
|
var empty_image := Image.create_empty(tile_size.x, tile_size.y, false, Image.FORMAT_RGBA8)
|
||||||
|
tiles.append(Tile.new(empty_image))
|
||||||
|
|
||||||
|
|
||||||
## Adds a new [param image] as a tile to the tileset.
|
## Adds a new [param image] as a tile to the tileset.
|
||||||
|
|
Loading…
Reference in a new issue