Chaining and compacting drawing commands


show more Chaining and compacting drawing commands provides you with in-depth training on Web. Taught by Ray Villalobos as part of the EaselJS First Look show less
please wait ...

Chaining and compacting drawing commands

Describing graphics with any programming language can yield very long files. EaselJS lets you combine methods together, so that complex objects can be described in a single line of code. It also lets you use shortcuts for some of the commands. Even the values within commands can be shortened and this is pretty exciting so let's take a look. I am starting off with a basic HTML template and a modified version of the end product of the video on defining lines and strokes, so make sure you take a look at that video if you need to understand how to define strokes and shapes.

So we have a graphic and a sequence of line commands. We can chain this together by putting all of the graphic commands one after the other. EaselJS is going to draw the graphic just fine. So what I am going to do is take this second graphic command and then delete the part that says shape.graphics and then attach it to the other command. So I am going to save and come over here and refresh, and you see ...

Chaining and compacting drawing commands
Video duration: 2m 56s 1h 28m Beginner

Viewers:

Chaining and compacting drawing commands provides you with in-depth training on Web. Taught by Ray Villalobos as part of the EaselJS First Look

Subject:
Web
Software:
CreateJS EaselJS
Author:
please wait ...