I will take my learning createjs some experience to share with you:
A. What is Createjs?
Createjs is a lightweight JavaScript library, an open source toolkit for HTML5 games that can build a rich interactive experience, using Createjs to build many interesting animation games. For example, surround the nerve cat, see you have many color such as HTML5 game.
Two. What are the Createjs tools?
There are four engines in Createjs:
- Easeljs: Mainly used in animation, vector and bitmap rendering. Provides a range of methods to support mobile device touch (click, MouseDown, Pressup, pressmove for mouse clicks, press, release, and move events, but before adding Createjs. Touch.enable (< Stage object >)).
- Tweenjs: is a motion tween animation engine, can produce a continuous change effect. (Children's shoes with flash should know what a motion tween is)
- Soundjs: is an audio playback engine, according to browser compatibility and performance selection audio format playback, can be loaded and unloaded at any time.
- Preloadjs: is a resource preload engine that can also specify the loading order and load resources by priority grouping.
Three. How to use easel to make a simple drag-and-drop?
Then if you need to use the EASELJS implementation can drag and drop a picture, and by clicking the picture to make the picture checked or unchecked, the selected state is a drag state, unchecked state is not dragging state. And at most one picture can be dragged and pulled. So how do you use EASELJS to implement this requirement and support the mobile-end device? Nonsense not much to say, on the source.
HTML code:
Because of the browser's homology policy, a local server needs to be opened, otherwise it will not load properly. OK, so that's the picture drag-and-drop effect you've asked for.