You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terry Cavanagh edited this page Feb 28, 2018
·
1 revision
Layer.drawto(layername:String);
Draw to the named layer. Call Gfx.drawtoscreen() when you're finished to draw to the screen again.
layername: The name of the layer to draw to.
Example:
importhaxegon.*;
classMain{
functioninit(){
Layer.create("foreground");
Layer.attach("foreground");
//Draw to the "foreground" layer.Layer.drawto("foreground");
for (iin0...200){
//Draw 200 random circles on the "foreground" layerGfx.fillcircle(Random.int(0, Gfx.screenwidth), Random.int(0, Gfx.screenheight), Random.int(50, 80), Col.hsl(Random.int(0, 360), 0.5, 0.5));
}
//Once we're done, we call this to draw to the screen again.Gfx.drawtoscreen();
}
functionupdate(){
}
}