Createjs 1th Chapter Easeljs Foundation (Drawing)

Source: Internet
Author: User

This chapter is the basic common API for learning Easeljs.
First download the Createjs library and create a new JS folder inside the project file.
http://code.createjs.com/

Various shapes

var sp = new Createjs. Shape (); SP.GRAPHICS.F ("Red"). DC (100,100,80);//Draw round//sp.graphics.beginfill ("Red"). Drawcircle (100,100,80); SP.GRAPHICS.F ("Red"). Dr (200,10,300,180);//Block//sp.graphics.beginfill ("Red"). DrawRect (200,10,300,180); SP.GRAPHICS.S ("Blue"). SS (5). MT (0,200). LT (1000,200). ES ();//Line SP.GRAPHICS.F ("Red"). RR (10,250,100,110,15);// Rounded Rectangle sp.graphics.f ("red"). De (120,250,100,110,15);//Ellipse sp.graphics.f ("Red"). DP (240, 250, 40, 5, 0.6,-90);//Star Var img= New Image ();  Img.src= "Http://www.airmn.com/blog/wp-content/uploads/2014/08/jinbi.jpg";  Img.onload=function () {  //alert ("imgloadok!!")    Sp.graphics.beginBitmapFill (IMG);      Sp.graphics.drawCircle (400,300,100);     Sp.shadow = new Createjs. Shadow ("#B1820C", 0,0,20);    Stage.update ();    }  Stage.addchild (SP);

Comprehensive Exercises:

<!doctype html>

The operation of the graphics can be abbreviated

Tiny Method Tiny Method
Mt MoveTo Lt LineTo
A/at Arc/arcto Bt Beziercurveto
Qt Quadraticcurveto (also CurveTo) R Rect
Cp Closepath C Clear
F Beginfill Lf Beginlineargradientfill
Rf Beginradialgradientfill Bf Beginbitmapfill
Ef EndFill Ss Setstrokestyle
S Beginstroke Ls Beginlineargradientstroke
Rs Beginradialgradientstroke Bs Beginbitmapstroke
Es Endstroke Dr DrawRect
Rr Drawroundrect Rc Drawroundrectcomplex
dc Drawcircle De DrawEllipse
Dp Drawpolystar P Decodepath
Sp.graphics.beginLinearGradientFill (["Rgba (254,241,103,0.5)", "Rgba (227,144,2,0.5)"],[0,1],hw,hh-40,hw,hh+40). Drawcircle (hw,hh,80); equals Sp.graphics.lf (["Rgba (254,241,103,0.5)", "Rgba (227,144,2,0.5)"],[0,1],hw,hh-40,hw,hh+40) . DC (HW,HH,80);

Createjs 1th Chapter Easeljs Foundation (Drawing)

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.