What are the limits to rendering non canvas html elements?

For developers using the Construct 2 Javascript SDK

Post » Mon Oct 06, 2014 12:57 am

Is it possible to use JQuery to create a few divs and instantiate another library? So for example, including some sort of calendar widget normally meant for webpages, or perhaps even using html form elements and jquery animations.

If it is possible, what are the limitations? I'm a little unclear on how the crosscompilers work in terms of what's available in the "browser"

Thanks!

Edit, here's a much more realistic example, embedding a facebook feed widget. Is this possible?
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
13
S
4
Posts: 303
Reputation: 1,705

Post » Mon Oct 06, 2014 1:26 am

Yes, it is possible. @pode had made plugins for some other HTML elements already.
B
108
S
26
G
258
Posts: 4,430
Reputation: 145,179

Post » Mon Oct 06, 2014 12:28 pm

All the form control plugins do is create a HTML element and float it above the canvas. In theory you can create any HTML content and float it above the canvas in the same way. Take a look at the implementation to those plugins to see how it's done.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,226

Post » Mon Oct 06, 2014 4:04 pm

The only issue would be with the CocoonJS compiler. I use DIV's for my Facebook plugin with both web apps and Phonegap apps sucessfully.
www.h1k3.tech

We are here for you!
B
87
S
22
G
16
Posts: 715
Reputation: 16,765

Post » Tue Oct 07, 2014 5:01 pm

I create an entire webGL canvas above the construct window for my Q3D plugin, and perform lots of complicated rendering. Not sure how well it works on mobile, but it works fine in nodewebkit.
B
75
S
13
G
8
Posts: 1,973
Reputation: 9,841

Post » Tue Oct 07, 2014 7:07 pm

Thanks for the answers everyone :)

So far it seems like crosswalk android and nodewebkit apps are literally just an embedded browser with all of the browser's normal javascript API available. That's pretty awesome. It seems the only limitation is to be careful that your elements are responsive to window size.


Whats the issue with cocoonJS? I read it's being deprecated for C2. Never used it, but the performance on crosswalk is awesome so far.
Developing Surolace, the survival role playing space game.

surolace-survival-role-playing-space-game_t116953
B
13
S
4
Posts: 303
Reputation: 1,705

Post » Tue Oct 07, 2014 7:15 pm

CocoonJS and Ejecta are not real browser engines and basically don't support a DOM, so you can't create any HTML elements. We've officially dropped support for CocoonJS and will likely drop Ejecta in future as well, largely because of the many limitations that come from working with non-browser engines.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,226

Post » Wed Oct 08, 2014 1:09 pm

Hello everyone,

As Ashley has already said, Canvas+ (previously known as CocoonJS) is not a complete browser. It is designed for high performance on canvas and WebGL based projects. In order to support DOM and other HTML elements, CocoonJS offers other runtime choices like Webview and Webview+. And we are also working on integrating Crosswalk and other runtimes. That should provide you with the right tool for the job in all kind of projects.

Regards,

Ludei team.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests