Advertisement
Guest User

Untitled

a guest
Sep 16th, 2011
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 I.sprite = Sprite("turd", I.width, I.height);
  2.  
  3.                 I.draw = function() {
  4.                     canvas.save();
  5.                     canvas.translate(this.x + this.width * 0.5, this.y + this.height * 0.5);
  6.                     canvas.scale(this.scale, this.scale);
  7.                     canvas.translate(-I.sprite.width * 0.5, -I.sprite.height * 0.5);
  8.                     this.sprite.draw(canvas, this.x, this.y);
  9.                     canvas.fillStyle = "rgba(0, 0, 200, 0.5)";  
  10.                     canvas.strokeRect (this.x - I.sprite.width, this.y - I.sprite.height, this.width, this.height);
  11.                     canvas.restore();
  12.                 };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement