[MGraphics] no jgraphics context


    Apr 04 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();
    	}
    }
    

    • Apr 04 2013 | 1:25 pm
      Im only allowed to redraw with provided variables through paint() function only ?
    • Apr 04 2013 | 2:53 pm
      That is correct.
    • Apr 04 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