Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I.sprite = Sprite("turd", I.width, I.height);
- I.draw = function() {
- canvas.save();
- canvas.translate(this.x + this.width * 0.5, this.y + this.height * 0.5);
- canvas.scale(this.scale, this.scale);
- canvas.translate(-I.sprite.width * 0.5, -I.sprite.height * 0.5);
- this.sprite.draw(canvas, this.x, this.y);
- canvas.fillStyle = "rgba(0, 0, 200, 0.5)";
- canvas.strokeRect (this.x - I.sprite.width, this.y - I.sprite.height, this.width, this.height);
- canvas.restore();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement