Open DaVince opened 9 years ago
That's coming from haxepunk's image class. But that's strange, this check isn't debug only, it should throw even in release.
That's from TmxObject.hx, it creates a rect in debug mode only:
#if debug
debug_graphic = com.haxepunk.graphics.Image.createRect(width, height, 0xff0000, .6);
debug_graphic.x = x;
debug_graphic.y = y;
#end
So what happens now? Should TmxObject.hx be fixed to create a 1x1 rect/circle in cases like these? Or should I always make my objects at least 1x1 big in Tiled? (That'd be a chore, frankly.)
If 0x0 is a legal size, that doesn't sound like an awful solution (modify TmxObject to draw a 1x1). However, also note that the TMX file is just XML: you could throw it into a text editor and replace all height/width="0" to ="1" pretty quickly.
When I run a game without debug mode, the game will run and properly recognize objects (as signified by the fact that I use a "startpoint" object that is 0 wide, 0 high, and positioned in a specific place).
But when I try to run this same game in debug mode, the game crashes and outputs this in the console:
Same bug for circle object, though then the error there is "radius".