Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by Ash_Blue

I have several fairly complex menus I'm loading into my game (skill trees, journal, equipment, ect). In order to draw them with a low performance impact I'm rendering them dynamically with a separate Canvas DOM element. Then drawing them as images. Here is a walkthrough of what I mean.

1. Create <canvas> html element (but do not inject physically into the page)
2. Draw all necessary graphics on new <canvas>
3. Attach <canvas> as an image to Impact game and draw

Is this method for flatting graphics safe? Will it cause problems with Ejecta or other HTML5 exporting programs? Please let me know any ideas or pros / cons you can think of.

1 decade ago by dominic

Ejecta fully supports offscreen canvases. Keep in mind though, that similar to images, big canvases need a lot of RAM and iOS typically grants your App only about 40-100mb.

Depending on the style of your game, you may also want to disable the 2x resolution on those offscreen canvases before getting their context (this is Ejecta specific):
offscreenCanvas.retinaResolutionEnabled = false;

~ http://impactjs.com/ejecta/overview#the-canvas-element

CocoonJS also supports offscreen canvases. I'm not sure about other frameworks, though.

1 decade ago by Ash_Blue

Dominic your responses are amazing as always. Thanks again!
Page 1 of 1
« first « previous next › last »