how to reload the canvas by external java script?

Discussion and feedback on Construct 2

Post » Sat Jul 19, 2014 11:56 am

I need to referesh my construct2 canvas by a hyperlink on my html5 document ...i tried the following code

Code: Select all
var c=document.getElementById("c2canvas");
var ctx=c.getContext("2d");

I thought maybe clearing the rect may call OnlayourStart function but i am getting null object in my ctx...then somewhere on internet i found this code where it was written it can refresh the canvas from the start.
Code: Select all
var oldcanv = document.getElementById('c2canvas');

var canv = document.createElement('c2canvas'); = 'canvas';

but this also did not work , i just need simple way to re-load my whole construct2 canvas by hyperlink the "On start Layout" would get call one time by its trigger whenever someone clicks the hyperlink.
Posts: 108
Reputation: 1,010

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests