Skip to content

Instantly share code, notes, and snippets.

@RafaelOliveira
Last active November 27, 2016 19:33
Show Gist options
  • Save RafaelOliveira/b2431a0d88f6ab1c8c71b3d6a3665f42 to your computer and use it in GitHub Desktop.
Save RafaelOliveira/b2431a0d88f6ab1c8c71b3d6a3665f42 to your computer and use it in GitHub Desktop.
function render(framebuffer: Framebuffer): Void {
var w1 = framebuffer.width / 2;
var h1 = framebuffer.height / 2;
var w2 = framebuffer.width / 3;
var h2 = framebuffer.height / 3;
var w3 = framebuffer.width / 6;
var h3 = framebuffer.height / 6;
var g2 = framebuffer.g2;
g2.begin(true);
g2.pushTranslation(w1, h1);
g2.fillCircle(0, 0, 100);
g2.pushTranslation(w2 * Math.sin(kha.Scheduler.time()), h2 * Math.cos(kha.Scheduler.time()));
g2.fillCircle(0, 0, 50);
g2.pushTranslation(w3 * Math.cos(kha.Scheduler.time()), h3 * Math.sin(kha.Scheduler.time()));
g2.fillCircle(0, 0, 25);
g2.popTransformation();
g2.popTransformation();
g2.popTransformation();
g2.end();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment