We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae465db commit df442a1Copy full SHA for df442a1
scripts/LDtkParser/LDtkParser.gml
@@ -250,10 +250,18 @@ function LDtkLoad(level_name) {
250
// add to entity_reference
251
entity_references[$ entity.iid] = inst;
252
253
- // TODO: Change this up for objects without sprites
254
var spr = object_get_sprite(object_id)
255
- var sw = sprite_get_width(spr)
256
- var sh = sprite_get_height(spr)
+ if (sprite_exists(spr)) {
+ var sw = sprite_get_width(spr)
+ 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
265
266
267
// Load the fields
0 commit comments