Forums > Javascript

[MGraphics] no jgraphics context

April 4, 2013 | 11:03 am

Hello there !

why im getting this error ? i cant call or paint within a custom function ?

mgraphics.init();
mgraphics.relative_coords = 1;
mgraphics.autofill = 0;
function paint() {
	with(mgraphics){
	mgraphics.rectangle(-.1, .1, .2, -.2);
	mgraphics.fill();
	}
}
function nofill(){
	with (mgraphics){
	rectangle(-.2, .2, .2, -.2);
	redraw();
	}
}

April 4, 2013 | 1:25 pm

Im only allowed to redraw with provided variables through paint() function only ?


April 4, 2013 | 2:53 pm

That is correct.


April 4, 2013 | 2:59 pm

and thats not a problem :) im just worrying about further performance if i need to always redraw all of the elements . Thanks


Viewing 4 posts - 1 through 4 (of 4 total)