actionscript-3flashsvgdisplaylistfxg

Does the graphics class or the FXG Path element support the lift pen command?


Does the DisplayObject.graphics draw vector support the lift command? I think that SVG path element has a command to lift the pen and then move it to another location. I'm wondering if the Path element in FXG, which is built on top of the DisplayObject.graphics API has the same action.

Example of Path in FXG:

<s:Path data="M 0 0 L 0 100 L 100 100 L 100 0 L 0 0" />

"M 0 0" means move the pen to position x0 y0. "L 0 100" means draw a line from the current position to x0 y100. The first number is x coordinate and second number is y coordinate in the Cartesian coordinate system created by René Descartes.

The invention of Cartesian coordinates in the 17th century by René Descartes (Latinized name: Cartesius) revolutionized mathematics by providing the first systematic link between Euclidean geometry and algebra. Using the Cartesian coordinate system, geometric shapes (such as curves) can be described by Cartesian equations: algebraic equations involving the coordinates of the points lying on the shape. For example, a circle of radius 2, centered at the origin of the plane, may be described as the set of all points whose coordinates x and y satisfy the equation x2 + y2 = 4.

More information on the FXG Path element.
More information on the Graphics class.

From my research it looks like it doesn't support it.


Solution

  • There is no lift pen command but it looks like I can use the Move command (M) more than once to create multiple, unconnected separate lines.

    <s:Path data="M10 10 H 90 M 10 90 H 90" height="100" width="100" y="127" x="356">
        <s:fill>
            <s:SolidColor alpha="1" color="#F6F6F6" xmlns:s="library://ns.adobe.com/flex/spark"/>
        </s:fill>
        <s:stroke>
            <s:SolidColorStroke alpha="1" caps="round" color="#000000" joints="round" miterLimit="3" pixelHinting="false" scaleMode="normal" weight="2" />
        </s:stroke>
    </s:Path>
    

    That path data says, "Move to 10 10 then draw a horizontal line for 90 pixels then move to 10 90 and draw another horizontal line for 90 pixels."

    That creates the following image:

    enter image description here

    One issue is that the fill not shown.