PokéRogue
    Preparing search index...

    The Debug component is a mixin that provides methods and properties for controlling the debug visualization of an Arcade Physics Body. When Arcade Physics debug mode is enabled globally, individual bodies can render their collision outlines and velocity vectors to the display, making it easier to visualize physics shapes and movement during development. This component lets you toggle those visuals per body and customize the outline color. Debug rendering carries a performance overhead and should never be enabled in production builds.

    interface Debug {
        debugBodyColor: number;
        debugShowBody: boolean;
        debugShowVelocity: boolean;
        setDebug(showBody: boolean, showVelocity: boolean, bodyColor: number): this;
        setDebugBodyColor(value: number): this;
    }

    Implemented by

    Index
    debugBodyColor: number

    The color of the body outline when it renders to the debug display.

    debugShowBody: boolean

    Set to true to have this body render its outline to the debug display.

    debugShowVelocity: boolean

    Set to true to have this body render a velocity marker to the debug display.

    • Sets the debug values of this body.

      Bodies will only draw their debug if debug has been enabled for Arcade Physics as a whole. Note that there is a performance cost in drawing debug displays. It should never be used in production.

      Parameters

      • showBody: boolean

        Set to true to have this body render its outline to the debug display.

      • showVelocity: boolean

        Set to true to have this body render a velocity marker to the debug display.

      • bodyColor: number

        The color of the body outline when rendered to the debug display.

      Returns this

      This Game Object.

    • Sets the color of the body outline when it renders to the debug display.

      Parameters

      • value: number

        The color of the body outline when rendered to the debug display.

      Returns this

      This Game Object.