Skip to content

Instantly share code, notes, and snippets.

@mikeemoo
Created August 30, 2012 10:34
Show Gist options
  • Select an option

  • Save mikeemoo/3525939 to your computer and use it in GitHub Desktop.

Select an option

Save mikeemoo/3525939 to your computer and use it in GitHub Desktop.
define(['core/Renderer'], function (Renderer) {
"use strict";
return new (Renderer.extend({
render: function (target, delta, game) {
var viewport = game.getViewport();
var canvas = viewport.getCanvas();
var ctx = canvas.getContext('2d');
var newPos = target.subtract(viewport.getOffset());
ctx.fillStyle = "#FF0000";
ctx.save();
ctx.translate(newPos.getRoundedX(), newPos.getRoundedY());
ctx.rotate(target.rotation);
ctx.beginPath();
ctx.arc(0, 0, target.getWidth(), 0, Math.PI, false);
ctx.closePath();
ctx.fill();
ctx.restore();
}
}))();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment