-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zero size objects work in game, but not during debug #35
Comments
That's coming from haxepunk's image class. |
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".
The text was updated successfully, but these errors were encountered: