2

So, I am making a game with HTML5, and I want to convert it to an app using CocoonJS. I have menus made in DOM, with HTML stuff, such as buttons that are binded to the script. Then the main game is in the Canvas element. Will it work with CocoonJS if I have other elements than Canvas, if not, is there any good way to kinda draw a menu inside the Canvas?

AJPerez
  • 3,435
  • 10
  • 61
  • 91

3 Answers3

3

Yes, you should be able to convert your game, but you'll likely want to use Webview+ instead of Canvas+.

Webview+: http://support.ludei.com/hc/en-us/articles/201952993

Canvas+ only has very basic support for dom elements and is geared toward a full screen canvas. I have an application that is split half dom and half canvas. Based on my tests the canvas element using Webview+ still gets an impressive performance boost.

Joshua
  • 1,260
  • 3
  • 17
  • 33
0

If you want performance, Ludei's recommendation is to migrate the UI also to the canvas element, and use Canvas+. You can also keep the UI as DOM elements, and use them in the system's webview, but it takes some time to adapt code.

Please, refer to the webview example: http://support.ludei.com/hc/en-us/articles/200807797-CocoonJS-Webview

And you can also download the code from the example here: http://storage.cocoonjsservice.ludei.com/demos/cjs6441660794458437135webview.zip

Txus Ordorika
  • 76
  • 1
  • 7
0

Just use WebView+ and your DOM elements would be fine along with your main canvas.

lephleg
  • 1,724
  • 2
  • 21
  • 41