Reputation: 28148
I'm using EaselJS for the first time and am confused as to how to load a bitmap onto the canvas as specific co-ordinates.
First I'm defining my EaselJS stage:
var stage = new createjs.Stage("ad_canvas");
Then I'm defining a new bitmap:
var skyLogo = new createjs.Bitmap("http://francesca-designed.me/sky-test/logo.png");
I'm then creating the x
& y
coordinates I'd like to place this bitmap at, and adding it to the stage.
skyLogo.x = 56;
skyLogo.y = 115;
stage.addChild(skyLogo);
I just get a blank canvas and no errors. I'm new to this, and I don't know what I've missed.
Upvotes: 2
Views: 1507
Reputation: 28148
I worked out the solution. The Bitmap must be added to the stage first, and then the positioning can occur:
var skyLogo = new createjs.Bitmap("http://francesca-designed.me/sky-test/logo.png");
stage.addChild(skyLogo);
skyLogo.x = 20;
skyLogo.y = 208;
stage.update();
Upvotes: 1