LoginSignup
1
0

More than 5 years have passed since last update.

lime.CanvasContextのつかいかた

Posted at
    var sprite = new lime.CanvasContext();
    sprite.draw = function(ctx) {
        ctx.fillStyle = "#123456";
        ctx.beginPath();
        ctx.moveTo(0, 0);
        ctx.lineTo(100, 0); 
        ctx.lineTo(100, 100);
        ctx.lineTo(0, 100);
        ctx.closePath();
        ctx.fill();
    };

という感じで、デフォルトだとdrawにはgoog.nullFunctionが入っているのでそれを上書きするとCanvas2DContextが渡されるので好きにやれば良い。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0