Max Zueff
Max Zueff

Reputation: 191

Why CreateJS don't drawing?

I can not find the error in this code . Please help me. I did everything according to the documentation.

var point;
var width = 10;
var height = 20;
var tilesz = 24;
var canvas = document.getElementById("board");
var stage = new createjs.Stage(canvas);

genField();

function genField () {
    point = new createjs.Shape();
    for (var y = 0; y < height; y++) {
        for (var x = 0; x < width; x++) {
            point.graphics.beginStroke("#555");
            point.graphics.drawCircle(x*tilesz, y*tilesz, tilesz);
        }
     }

}

Upvotes: 1

Views: 50

Answers (1)

Aleksandar Varicak
Aleksandar Varicak

Reputation: 1068

You're not adding points to the stage. So in for just add lines:

stage.addChild(point);
stage.update();

Does this help?

Upvotes: 1

Related Questions