RSX Code Reference
    Preparing search index...

    Class Path

    A vector path. Can be used to build curves and shapes using vector paths rather than pixels.

    The path uses even-odd fill rule to draw the shapes. Solid shapes should have counter clockwise winding and holes should have counter clockwise order. To specify winding of a path you can call This is useful especially for the common shapes, which are drawn counter-clockwise.

    Filling and stroking are executed using a The describes a solid color or a gradient. You can set the paint by calling or

    You can use scissors to cut a part from a shape. This can be useful when you have a path, but only wants to use a section of it. You can set a scissor by calling You can reset any scissor by calling

    You can close any path, at any time, by calling Sub-paths are closed with a straight line to its first point.

    Paths can be rendered to a texture. To render a path to a texture you need to first convert it into a

    The object holds the list of all commands that need to be executed by the system to render the required shape. You can submit a shape for rendering using it's method. See in how to render the shape object.

    Index
    • Creates a new empty path.

      Returns Path

    • Creates a new path from the specified svgSourceContents.

      Parameters

      • svgFileContents: string
      • OptionalisInternalConstructor: boolean

      Returns Path

    • Creates a new path by copying another path.

      Parameters

      Returns Path

    • get empty(): boolean

      Checks if the path is empty and has no commands.

      Returns boolean

    • Adds an arc segment at the corner defined by the last path point, and two specified points.

      Parameters

      Returns Path

    • Adds an arc segment at the corner defined by the last path point, and two specified points.

      Parameters

      • x1: number
      • y1: number
      • x2: number
      • y2: number
      • radius: number

      Returns Path

    • Adds cubic bezier segment from last point in the path via two control points to the specified point.

      Parameters

      Returns Path

    • Adds cubic bezier segment from last point in the path via two control points to the specified point.

      Parameters

      • c1x: number
      • c1y: number
      • c2x: number
      • c2y: number
      • x: number
      • y: number

      Returns Path

    • Creates new circle shaped sub-path with the given radius and with it's center at origin.

      Parameters

      Returns Path

    • Creates new circle shaped sub-path with the given radius and with it's center at origin.

      Parameters

      • x: number
      • y: number
      • radius: number

      Returns Path

    • Creates new ellipse shaped sub-path with the given radius and with it's center at origin.

      Parameters

      Returns Path

    • Creates new ellipse shaped sub-path with the given radius and with it's center at origin.

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number

      Returns Path

    • Adds line segment from the last point in the path to the specified point.

      Parameters

      Returns Path

    • Adds line segment from the last point in the path to the specified point.

      Parameters

      • x: number
      • y: number

      Returns Path

    • Adds quadratic bezier segment from last point in the path via a control point to the specified point.

      Parameters

      Returns Path

    • Adds quadratic bezier segment from last point in the path via a control point to the specified point.

      Parameters

      • cx: number
      • cy: number
      • x: number
      • y: number

      Returns Path

    • Creates new rounded rectangle shaped sub-path.

      Parameters

      • rect: Immutable<Rect2>
      • topLeft: number
      • topRight: number
      • bottomRight: number
      • bottomLeft: number

      Returns Path

    • Creates new rounded rectangle shaped sub-path.

      Parameters

      Returns Path

    • Creates new rounded rectangle shaped sub-path.

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number
      • topLeft: number
      • topRight: number
      • bottomRight: number
      • bottomLeft: number

      Returns Path

    • Creates new rounded rectangle shaped sub-path.

      Parameters

      Returns Path

    • Creates new rounded rectangle shaped sub-path.

      Parameters

      Returns Path

    • Creates new rounded rectangle shaped sub-path.

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number
      • radius: number

      Returns Path

    • Closes current sub-path with a line segment.

      Returns Path

    • Creates a new shape based on the given path.

      Returns Shape

    • Disables both the write masking and read masking, transitioning to the normal mode of drawing, without masking.

      Returns Path

    • Disables both the write masking and read masking, transitioning to the normal mode of drawing, without masking.

      Parameters

      Returns Path

    • Fills the current sub-path with current fill style.

      Returns Path

    • Starts new sub-path with specified point as first point.

      Parameters

      Returns Path

    • Starts new sub-path with specified point as first point.

      Parameters

      • x: number
      • y: number

      Returns Path

    • Clears the path and remove all recorded commands.

      Returns void

    • Reset and disables scissoring.

      Returns Path

    • Enables or disables the anti aliasing.

      Parameters

      • antiAliasing: boolean

      Returns Path

    • Sets current fill style to a paint, which can be a one of the gradients or a solid color.

      Parameters

      Returns Path

    • Sets the miter limit of the stroke style. Miter limit controls when a sharp corner is beveled.

      Parameters

      • miterLimit: number

      Returns Path

    • Enables reading a stencil mask previously written using SetWriteMask for the shapes that were drawn using that write mask. The operation has 2 modes: one in which only the pixels that have the stencil value, i.e. intersection, and the second one in which pixels that do not have that mask will pass, i.e. the difference of shapes. Only fill commands will be affected by this setting.

      Parameters

      • value: number

        The mask value to compare against

      • isIntersect: boolean

        If set, the intersection will pass, else the difference will pass

      Returns Path

    • Sets current stroke style to a paint, which can be a one of the gradients or a solid color.

      Parameters

      Returns Path

    • Sets the stroke width of the stroke style.

      Parameters

      • width: number

      Returns Path

    • Enables writing a stencil mask for the shapes that will be rendered after this call. Only fill commands will write masks. To draw the shapes, just do it normally, the Path will make sure the stencil masking is enabled.

      Parameters

      • value: number

        The mask value to write to the stencil

      • isDrawDisabled: boolean

        A boolean flag which enables or disables writing color to the framebuffer While the mask operation is set. If set, colors will not be outputed, else colors will be written.

      Returns Path

    • Fills the current sub-path with current stroke style.

      Returns Path