Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the function of EaselJS?

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The main content of this article is to explain "what is the role of EaselJS". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the role of EaselJS?"

EaselJS is a JavaScript library for easy and quick manipulation of HTML5Canvas tags. It has a very friendly experience in creating H5 games, generating works of art, and dealing with other advanced graphics. It consists of a complete, hierarchical display list, a core interaction model, and auxiliary classes that make it easier to work with the canvas.

Some core classes in EaselJS

StageClass-- creates the stage

TextClass-- draw text

Drawing graphics with GraphicsClass--

Drawing graphics with ShapeClass--

Drawing pictures with BitmapClass--

TickerClass-- scheduled broadcast

. Etc.

Some examples of EaselJS

Draw text (TextClass)

Define a canvas.

/ / HTML:

Call API-newcreatejs.Text () provided by EaselJS to draw the text

/ / JS

_ window.onload= () = > {

/ * *

* TestClass text class-- demo

* /

Letstage1=newcreatejs.Stage ("demo1")

Lettext1=newcreatejs.Text ("Text1!", "bold26pxArial", "# ff7700")

Offset of text1.regX=-50;// along the negative direction of the X axis

Offset of text1.regY=-50;// along the negative direction of the Y axis

Text1.x=100;// draws X coordinates of source point

Text1.y=50;// draws Y coordinates of source point

Lettext2=newcreatejs.Text ("rotate + XY stretch!" , "bold18pxArial", "# ff7700")

Text2.x=50

Text2.y=50

Text2.rotation=50;// rotation angle DEG

Text2.scaleX=3;//X axis magnification (stretch)

At this point, I believe that you have a deeper understanding of "what is the role of EaselJS", you might as well come to the actual operation! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report