Go to layout through Javascript?

Get help using Construct 2

Post » Wed Sep 04, 2013 2:17 am

Is there any way I could call a layout through Javascript?

First off, I am aware of the Call Javascript plugin. I currently use Pode's HTML pack (the div one) and import CSS plugins to have an HTML calendar render on my layout within Construct. What I wanted to achieve was, on clicking a day of the calendar, the action would take you to a layout. How do I achieve this?

I know I will probably have to use the Call JS plugin (or do the Javascript right into the HTML), and all I want to do is attach each calendar cell to a function that calls a layout on click. Again, I can't do this with events since the calendar is in HTML, or can I?

Thank you in advance.
B
13
S
5
G
1
Posts: 34
Reputation: 2,022

Post » Wed Sep 04, 2013 10:32 am

One straightforward way of doing it would be to make your own plugin in the Javascript SDK. Then on some JS function you can fire a trigger in the event engine, and in your project events, on that trigger go to a layout.
Scirra Founder
B
399
S
236
G
89
Posts: 24,546
Reputation: 195,436

Post » Thu Sep 05, 2013 12:43 am

Thank you, @Ashley! I am still a novice with JS (and programming in general), but it surely makes sense now. That plugin will be my first real JS project goal. I am definitely inspired now.
B
13
S
5
G
1
Posts: 34
Reputation: 2,022


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests