Javascript lightweight library createjs uses Easel to implement drag-and-drop effects, createjseasel

Source: Internet
Author: User

Javascript lightweight library createjs uses Easel to implement drag-and-drop effects, createjseasel

I will share with you some of my experiences on learning Createjs:

1. What is CreateJS?

Createjs is a lightweight javascript library. It is an open-source toolkit for building HTML5 games with rich interactive experience. Using createjs, you can build many interesting animation games. For example, you can watch Html5 games such as multi-color games.

Ii. What tools does CreateJS have?

There are four engines in createjs:

  • EaselJS: used to draw animations, vectors, and bitmaps. It provides a series of methods that support mobile device touch (click, mousedown, pressup, and pressmove are the mouse click, press, release, and move events, but createjs must be added before. touch. enable (<stage Object> )).
  • TweenJS: it is an engine used to create compensation animation. It can produce a continuously changing effect. (Flash shoes should be used to know what an animation is)
  • SoundJS: it is an audio playback engine. You can select the audio format for playback Based on the browser compatibility and performance. It can be loaded and detached at any time.
  • PreloadJS: A Resource pre-loading engine. You can specify the loading sequence and group resources by priority.

3. How can I use Easel to create a simple drag?

If you need to use EaselJs to drag an image at will, and click the image to make the image in the selected or unselected status, the selected status is the drag status, if the status is not selected, it cannot be dragged. You can drag up to one image. So how can we use EaselJs to achieve this requirement and support mobile devices? Let's talk about the source code.

HTML code:

<Html> 


Because of the same-origin policy of the browser, a local server needs to be opened; otherwise, the server cannot be loaded normally. Well, this is the image drag effect required above.

Articles you may be interested in:
  • Div drag plug-in -- JQ. MoveBox. js (self-made JQ plug-in)
  • Example of how Javascript achieves gravity bounce drag
  • Extjs4: How to drag data between two gridpanels
  • Javascript drag and drop upload class library DropzoneJS usage
  • ExtJS drag result example
  • Javascript Implementation of moving a child form by dragging the mouse
  • Js drag and drop some common ideas and methods
  • Nodejs + express + html5 implement drag-and-drop upload
  • Js implementation drag effect
  • JS pop-up complete div layer instance that can be dragged and closed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.