import IGraphicsPath from "./IGraphicsPath"; import IGraphicsData from "./IGraphicsData"; import GraphicsPathWinding from "./GraphicsPathWinding"; import Vector from "../Vector"; declare namespace openfl.display { /** * A collection of drawing commands and the coordinate parameters for those * commands. * * Use a GraphicsPath object with the * `Graphics.drawGraphicsData()` method. Drawing a GraphicsPath * object is the equivalent of calling the `Graphics.drawPath()` * method. * * The GraphicsPath class also has its own set of methods * (`curveTo()`, `lineTo()`, `moveTo()` * `wideLineTo()` and `wideMoveTo()`) similar to those * in the Graphics class for making adjustments to the * `GraphicsPath.commands` and `GraphicsPath.data` * vector arrays. * * @see [Using graphics data classes](https://books.openfl.org/openfl-developers-guide/using-the-drawing-api/advanced-use-of-the-drawing-api/using-graphics-data-classes.html) * */ export class GraphicsPath implements IGraphicsPath, IGraphicsData { /** * Creates a new GraphicsPath object. * * @param winding Specifies the winding rule using a value defined in the * GraphicsPathWinding class. * */ constructor(commands?: Vector, data?: Vector, winding?: GraphicsPathWinding); /** * The Vector of drawing commands as integers representing the path. Each * command can be one of the values defined by the GraphicsPathCommand class. * */ commands: Vector; /** * The Vector of Numbers containing the parameters used with the drawing * commands. * */ data: Vector; /** * Specifies the winding rule using a value defined in the * GraphicsPathWinding class. * */ winding: GraphicsPathWinding; /** * Adds a new "cubicCurveTo" command to the commands vector and new coordinates to * the data vector. * * @param controlX1 A number that specifies the horizontal position of the first * control point relative to the registration point of the parent display object. * @param controlY1 A number that specifies the vertical position of the first * control point relative to the registration point of the parent display object. * @param controlX2 A number that specifies the horizontal position of the second * control point relative to the registration point of the parent display object. * @param controlY2 A number that specifies the vertical position of the second * control point relative to the registration point of the parent display object. * @param anchorX A number that specifies the horizontal position of the next anchor * point relative to the registration point of the parent display object. * @param anchorY A number that specifies the vertical position of the next anchor * point relative to the registration point of the parent display object. * */ cubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void; /** * Adds a new "curveTo" command to the `commands` vector and new * coordinates to the `data` vector. * * @param controlX A number that specifies the horizontal position of the * control point relative to the registration point of the * parent display object. * @param controlY A number that specifies the vertical position of the * control point relative to the registration point of the * parent display object. * @param anchorX A number that specifies the horizontal position of the * next anchor point relative to the registration point of * the parent display object. * @param anchorY A number that specifies the vertical position of the next * anchor point relative to the registration point of the * parent display object. * */ curveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void; /** * Adds a new "lineTo" command to the `commands` vector and new * coordinates to the `data` vector. * * @param x The x coordinate of the destination point for the line. * @param y The y coordinate of the destination point for the line. * */ lineTo(x: number, y: number): void; /** * Adds a new "moveTo" command to the `commands` vector and new * coordinates to the `data` vector. * * @param x The x coordinate of the destination point. * @param y The y coordinate of the destination point. * */ moveTo(x: number, y: number): void; /** * Adds a new "wideLineTo" command to the `commands` vector and * new coordinates to the `data` vector. * * @param x The x-coordinate of the destination point for the line. * @param y The y-coordinate of the destination point for the line. * */ wideLineTo(x: number, y: number): void; /** * Adds a new "wideMoveTo" command to the `commands` vector and * new coordinates to the `data` vector. * * @param x The x-coordinate of the destination point. * @param y The y-coordinate of the destination point. * */ wideMoveTo(x: number, y: number): void; } } export default openfl.display.GraphicsPath;