createjseaseljs

CreateJs not showing an image


I am new to create js and I want to show an image in localhost:8000

This is the index.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Movement Test</title>
        <script src="https://code.createjs.com/1.0.0/createjs.min.js"></script>
        <script src="game.js"></script>
    </head>
    <body onload="init()">
        <canvas id="gameCanvas" width="640" height="480" style="display: block; margin: 0 auto;"></canvas>
    </body>
</html>

And this is the game.js

function init() {
    var stage = new createjs.StageGL("gameCanvas")

    var image = new createjs.Bitmap("dababyconvertible.jpg")
    stage.addChild(image)
}

Solution

  • Maybe check here: LINK

    You should use stage.update() and something else :)