Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    A class based on PIXI.Graphics, that allows to create a resize handle in the desired area.

    Hierarchy

    • SmoothGraphics
      • ResizeHandle
    Index

    Constructors

    • Parameters

      • offset: number[]

        A two-element array [xFactor, yFactor] which defines the normalized position of this handle relative to the bounding box.

      • Optionalhandlers: { canDrag?: Function } = {}

        An object of optional handler functions.

        • OptionalcanDrag?: Function

          A function determining if this handle can initiate a drag.

      Returns ResizeHandle

    Properties

    active: boolean = false

    Track whether the handle is being actively used for a drag workflow

    Methods

    • Activate listeners for pointer events, enabling hover and mouse-down behavior on the resize handle.

      Returns void

    • Refresh the position and hit area of this handle based on the provided bounding box.

      Parameters

      • bounds: Rectangle

        The bounding box in which this handle operates.

      Returns void

    • Compute updated dimensions for an object being resized, respecting optional constraints.

      Parameters

      • current: Rectangle

        The current geometric state of the object

      • origin: Rectangle

        The original position and dimensions used for reference

      • destination: { x: number; y: number }

        The mouse (or pointer) destination coordinates.

        • x: number

          The x-coordinate where the pointer was released.

        • y: number

          The y-coordinate where the pointer was released.

      • Optionaloptions: { aspectRatio?: number | null } = {}

        Additional options.

        • OptionalaspectRatio?: number | null

          If provided, a numeric aspect ratio to maintain (width/height).

      Returns object

      An object containing the adjusted {x, y, width, height}.

    • Protected

      Handle mouse-over event on a control handle

      Parameters

      • event: FederatedEvent<UIEvent | PixiTouch>

        The mouseover event

      Returns void

    • Protected

      Handle mouse-out event on a control handle

      Parameters

      • event: FederatedEvent<UIEvent | PixiTouch>

        The mouseout event

      Returns void

    • Protected

      When we start a drag event - create a preview copy of the Tile for re-positioning

      Parameters

      • event: FederatedEvent<UIEvent | PixiTouch>

        The mousedown event

      Returns void