![]() The following line of code would generate the instructions to draw a rectangle with a red stroke and blue fill: myGraphics.beginStroke("red").beginFill("blue").drawRect(20, 20, 100, 50) Įach graphics API call generates a command object (see below). var g = new createjs.Graphics() Īll drawing methods in Graphics return the Graphics instance, so they can be chained together. The former abstracts the latter, simplifying beginning and ending paths, fills, and strokes. Instantiating Graphics command objects and adding them to the graphics queue via append. ![]() There are two approaches to working with Graphics object: calling methods on a Graphics instance (the "Graphics API"), or Note that you can use Graphics without any dependency on the EaselJS framework by calling drawĭirectly, or it can be used with the Shape object to draw vector graphics within the ![]() The Graphics class exposes an easy to use API for generating vector drawing instructions and drawing them to a
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |