Easel JS Simplifies Working with Canvas in HTML5

The new Canvas element in HTML5 is powerful, but it can be difficult to work with. It has no internal concept of display objects, so you are required to manage updates manually. The Easel Javascript library provides a full, hierarchical display list, a core interaction model, and helper classes to make working with Canvas much simpler.

We built Easel based on what we learned while building Pirates Love Daisies, then retrofitted the game to use it. Development on the project would have been a lot simpler if we had Easel from the start.

Easel is being released for free under the MIT license, which means you can use it for almost any purpose (including commercial projects). We appreciate credit where possible, but it is not a requirement.

Examples, API documentation, and the latest version of the library can always be found at EaselJS.com.

Easel is currently in early alpha. We will be making significant improvements to the library, samples, and documentation over the coming weeks. Please be aware that this may necessitate changes to the existing API. We will also be moving it to Google code or GitHub and opening it to contributors once we feel like it’s in a decent beta state.

The API is loosely based on Flash’s display list, and should be easy to pick up for both JS and AS3 developers. In our preliminary testing, Easel appears to be fully compatible with iOS, Android, and all major browsers that support the canvas element.

We welcome feedback on the library in the comments below, at least until we get something more permanent in place.

Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

32 Comments

  1. Awesome, today I spend the day doing/learning JS after a day with ProcessingJS, and was wondering about a library that could allow me to work more like Flash does.

    Thanks a lot!
    – rS

  2. It looks neat! It seems that flash devs are convinced by the power of HTML5. I am gonna play with the API right away. Thanks for making my weekend a perfect one :)

  3. […] This post was mentioned on Twitter by Grant Skinner, John Dowdell, Mike Downey, Kai Hannonen, Estes Ethan and others. Estes Ethan said: RT @gskinner: A little more info about the Easel JS release: http://is.gd/iUqWi #HTML5 #JS #javascript […]

  4. This looks awesome, might move some code away from Raphael JS into this. Thought about putting it up on github?

  5. This is awesome. The display object hierarchy is something I really like in AS, and in case Flash was overshadowed by HTML5 someday, I would really miss it. AS3 is just too great to work with, that’s why I’m not very keen on HTML5. But this library might change my mind. Thanks Grant.

  6. are you guys open to contributions?

  7. keegan – yes, definitely. Our current plan is to get out one more release, so we can clear a few things off our to do list and polish up the core architecture. With that done, we’ll move it to GitHub to make it easy for anyone to contribute to.

    If you’d like to contribute before then, feel free to fire me an email (the contact link at the top left).

  8. […] is a new library from Grant Skinner that somewhat mimics the Flash display list/display object heirarchy.  It is the result of the game Pirates Love Daisies which demonstrates some great gameplay in […]

  9. […] library JavaScript, desarrollada por Grant Skinner, para trabajar con el canvas de HTML5 como si se tratase de una aplicación Flash; eso sí, […]

  10. Great idea to do this, thanks! We have had half an eye on canvas as a mobile cross-platform vehicle for a little while now. I am curious; what IDE do you use for this kind of JS programming?

  11. Sorry – read the PLD post and I see you are using DW. Doh

  12. […] Graphing Library Easel JS: A Javascript Library for Working with the HTML5 Canvas Element. (via gskinner.com: Easel JS Simplifies Working with Canvas in HTML5) MooTools Canvas […]

  13. […] objects. Grant and his team have put together a utility that adds this Flash- like functionality: EasleJS. Check it out and let me know how it works for […]

  14. […] to manage updates manually (see our earlier posts for some more tips on working with Canvas). The gskinner blog post has some more details on what Easel JS does, but the main points are a core interaction model with a full, hierarchical […]

  15. […] to manage updates manually (see our earlier posts for some more tips on working with Canvas). The gskinner blog post has some more details on what Easel JS does, but the main points are a core interaction model with a full, hierarchical […]

  16. […] to manage updates manually (see our earlier posts for some more tips on working with Canvas). The gskinner blog post has some more details on what Easel JS does, but the main points are a core interaction model with a full, hierarchical […]

  17. […] Adres URL: gskinner.com: gBlog: Easel JS Simplifies Working with Canvas in HTML5 […]

  18. Shape.arc() method needs to pass ‘radius’ value to the context.arc(), no?

  19. […] to manage updates manually (see our earlier posts for some more tips on working with Canvas). The gskinner blog post has some more details on what Easel JS does, but the main points are a core interaction model with a full, hierarchical […]

  20. […] to manage updates manually (see our earlier posts for some more tips on working with Canvas). The gskinner blog post has some more details on what Easel JS does, but the main points are a core interaction model with a full, hierarchical […]

  21. […] to manage updates manually (see our earlier posts for some more tips on working with Canvas). The gskinner blog post has some more details on what Easel JS does, but the main points are a core interaction model with a full, hierarchical […]

  22. I know you’re working on the graphics API stuff, but have you given any thought to redrawing the canvas with a dirty rectangle kind of algorithm? Would it even be possible to solve for the bounds of a DisplayObject before its drawing commands are handed to the 2D context?

  23. Can´t wait for the right moment (stable version) to start working on a JSFL based export from Flash IDE.

  24. BitmapSequence.js: In line 101 Undefined variable ttllFrames (I assume this would be ttlFrames)

  25. This looks great Grant – thanks for sharing! I definitely want to dig into this more, since I started going down the road of writing my own framework for working with canvas efficiently.

  26. I’m new to canvas but not JavaScript, and am curious about something. In Pirates Love Daisies why did you choose to have the game utilize the DOM as much as you did (e.g. divs for various UI components) instead of putting everything in one big canvas element?

    Great job BTW the game looks like a blast (I’d play it now at work if I could get away with it).

  27. […] Guru) has made a js library, EaselJS, that's loosely bases on the Flash display list.More info:http://gskinner.com/blog/archivehttp://www.mikechambers.com/blog…Insert a dynamic date hereView All 0 CommentsCannot add comment […]

  28. Love it, love it, love it!

    Confused, though.

    Stage’s prototype is a Container, whose prototype is a DisplayObject. All of their constructors call this.init(), but the Stage’s init called this.__init() which is a call back for init(), and Container’s init calls this._init() which is a call back for init()

    I guess I don’t understand how this bypasses JS’s inability to perform multiple inheritance.

  29. Does anyone have a suggestion how I can get hold of the width and height of DisplayObjects?

    It’s getting really frustrating trying to work this out.

    Thanks for your effort on producing this library, makes life for flash devs a little easier when working with canvas.

    Neil

  30. […] is a new library from Grant Skinner that somewhat mimics the Flash display list/display object heirarchy.  It is the result of the game Pirates Love Daisies which demonstrates some great gameplay in […]

  31. Dear Grant,
    You did a really great job and i hope that easel will supported further on. I’m developing in flash since 1998. The canvas element is very interesting but many missing features, like events for images and drawn elements, are very sad. After working with easel for a couple of hours i feel like coming home…..

    Thanx a lot for sharing.

    Mark

Comments are closed.