First, go to http://createjs.com/ to download the latest version of EaselJS. After downloading and decompressing, you can find easeljs-0.8.1.min.js in the lib folder. At the same time, you can find an examples and tutorials directory in the compressed package. The two directories contain some introductory introductions and examples. If you have English basics, you can take a look. The DOC folder contains all the apis of easeljs. (Similarly, the other three items included in createjs can be obtained, and their directory structure is similar to that of EaselJS).
1. After getting easeljs-0.8.1.min.js, create a new HTML5 file and import it:
2. Entry function and create canvas tag
<canvas id="game" width="1000" height="700" style="background-color: white"></canvas>
</body>
3. Write your own javascript code. In the function init(), you should first use the canvas tag in HTML to create a Stage. All elements used in createjs are added in this stage. After adding, call stage.update () method to make the added element displayed on the page. When creating a Stage, you can directly use the id of the Canvas to create it, or you can call document.getElementById("game") and select the canvas to create it, there is no difference.
stage.update();
}
</script>