I'm working with easeljs javascript to create a type of game I am using this example:
As you can see that the spacers are the graphics objects:
this.graphics.beginStroke ("#FFFFFF"); I have to fill the background with this image:
var bitmap = new createjs.bitmap ("http://nielsvroman.be/ Twitter / root / easeljs / image.png "); This.graphics.beginBitmapFill (bitmap, "no-rikat"); But I always get this error:
Unkit type error: type error
Does anyone know what I'm doing is wrong?
Use the context for an HTML image, and no bitmap examples. var image = new image (); Image.srce = "http://nielsvroman.be/twitter/root/easeljs/image.png"; This.graphics.beginBitmapFill (image, "no-repeat"); Note that you must ensure that the image is full, otherwise it can not appear on the first step update. You can either stick to the stage, or listen to the image for onload, and then refresh the forum.
image.onload = function () {stage.update (); }
No comments:
Post a Comment