Skip to content

Commit df442a1

Browse files
committed
add x/yscale back after a typo in pull #2
1 parent ae465db commit df442a1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/LDtkParser/LDtkParser.gml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,18 @@ function LDtkLoad(level_name) {
250250
// add to entity_reference
251251
entity_references[$ entity.iid] = inst;
252252

253-
// TODO: Change this up for objects without sprites
254253
var spr = object_get_sprite(object_id)
255-
var sw = sprite_get_width(spr)
256-
var sh = sprite_get_height(spr)
254+
if (sprite_exists(spr)) {
255+
var sw = sprite_get_width(spr)
256+
var sh = sprite_get_height(spr)
257+
258+
inst.image_xscale = entity.width / sw
259+
inst.image_yscale = entity.height / sh
260+
}
261+
else {
262+
inst.image_xscale = 1
263+
inst.image_yscale = 1
264+
}
257265

258266

259267
// Load the fields

0 commit comments

Comments
 (0)