cykod / Quintus

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

Double setup() bug #98

Closed ivars-vids closed 10 years ago

ivars-vids commented 10 years ago

When I call Q.setup() more than once, I use this as easiest way to resize canvas. After second, third Q.setup() call, it creates additional wrapper.

... var Q = Quintus().setup({ height: 100, width: 100 }) ... Q.setup({ maximize: true }); ...

... <div id="quintus_container" style="width: 100px; margin: 0px auto; position: relative;"> <div id="quintus_container" style="width: 550px; margin: 0px auto; position: relative;"> <canvas width="550" height="415" id="quintus" style="height: 415px; width: 550px; position: relative; outline: 0px none;" tabindex="0"></canvas> </div> </div> ...

ghost commented 10 years ago

Hi @ivars-vids , you don't need to use Q.setup() to resize the canvas, you can use Q.el which is a reference to the canvas element and just change its width/height.

Also Q.ctx is the canvas context :)

ghost commented 10 years ago

This is now fixed.

Thanks for your report.