API reference
Preparing search index…

Shape

Abstract

Custom shapes publish a convex point outline by calling update().

Type hierarchy

Hierarchy (View Summary)

Source & inheritance
Member directory41

Constructors

Properties

Methods

Constructors

  • Creates a custom convex shape; subclasses provide points and call update().

    Parameters

    init
    ShapeInit = ...

    Returns

    Source & inheritance

Properties

shapeInfo: Readonly<NativeShapeInfo>
Source & inheritance

Methods

  • Parameters

    operation
    number
    x
    number
    yOptional
    number
    zOptional
    number

    Returns

    void
    Source & inheritance
  • Returns an independent copy of the fill color.

    Returns

    Source & inheritance
  • Returns the shape's geometric center in local coordinates.

    Returns

    Source & inheritance
  • Returns local axis-aligned bounds including the outline.

    Returns

    Source & inheritance
  • Returns the outline miter limit.

    Returns

    number
    Source & inheritance
  • Returns an independent copy of the outline color.

    Returns

    Source & inheritance
  • Returns the outline thickness.

    Returns

    number
    Source & inheritance
  • Returns the outline point count.

    Returns

    number
    Source & inheritance
  • Return a copy of the rotation normalized to [0°, 360°).

    Returns

    Source & inheritance
  • Returns the current texture reference, or null if none is set.

    Returns


        | null
        | Readonly<
            Pick<
                Texture,
                | "getSize"
                | typeof graphicsNative
                | typeof textureId
                | typeof textureOwner
                | "copyToImage"
                | "isSmooth"
                | "isRepeated"
                | "isSrgb"
                | "getNativeHandle",
            >,
        >
    Source & inheritance
  • Sets the fill color, multiplied by the texture color when drawing.

    Parameters

    this
    ShapeResource

    Returns

    void
    Source & inheritance
  • Sets the maximum ratio of outline miter extension to thickness; must be at least 1.

    Parameters

    this
    ShapeResource
    limit
    number

    Returns

    void
    Source & inheritance
  • Sets outline thickness in local coordinates; positive values extend outward and negative values inward.

    Parameters

    this
    ShapeResource
    thickness
    number

    Returns

    void
    Source & inheritance
  • Sets and retains a texture reference; null disables texturing, and resetRect true covers the entire texture.

    Parameters

    this
    ShapeResource
    texture

        | null
        | Readonly<
            Pick<
                Texture,
                | "getSize"
                | typeof graphicsNative
                | typeof textureId
                | typeof textureOwner
                | "copyToImage"
                | "isSmooth"
                | "isRepeated"
                | "isSrgb"
                | "getNativeHandle",
            >,
        >
    resetRect
    boolean = false

    Returns

    void
    Source & inheritance
  • Copies the texture pixel region to use; negative sizes can flip the texture.

    Parameters

    this
    ShapeResource

    Returns

    void
    Source & inheritance
  • Rebuilds native geometry from the subclass's getPointCount/getPoint; call after changing custom points.

    Parameters

    this

    Returns

    void
    Source & inheritance

Symbol members

"[graphicsNative]": NativeGraphicsHandle<"shape">
Source & inheritance
"[mutableValue]": true
Source & inheritance
"[shapeState]": ShapeData
Source & inheritance
"[transformableState]": TransformableState
Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0