cykod / Quintus

HTML5 Game Engine
http://html5quintus.com
GNU General Public License v2.0
1.41k stars 401 forks source link

Add auto bounding box #118

Closed joseadrian closed 10 years ago

joseadrian commented 10 years ago

If there is a property called boundingBox on any layer, the maxX and maxY of the boundingBox property will be the width and height of that layer. The minX and minY are 0

ghost commented 10 years ago

Can you provide more information about the issue? more details and/or what exactly the problem is... maybe some screenshots? Thanks.

joseadrian commented 10 years ago

I considere it a little enhancement. This avoid having to set the bounding box of the viewport manually when you use a Tiled map. It gets the width and height and set it as the maxX and maxY of the bounding box. You just need to add an attribute "boundingBox": true. on any layer.

Img

If this is not accepted, it could be implemented as a component.

Thanks.

ghost commented 10 years ago

I see now this is interesting, but it may take time to be in the source as it needs a proper analysis from the other members. Thank you.

fariazz commented 10 years ago

Works well. Nice addition @joseadrian !