Skip to main content

FlixelDebugDrawable

View source

interface

org.flixelgdx.debug.FlixelDebugDrawable

public interface FlixelDebugDrawable

Interface for objects that can draw a debug bounding box in the FlixelDebugOverlay. Any class that implements this will automatically appear when visual debug drawing is enabled, without being hard-coded into the overlay.

FlixelObject implements this by default, using collision state to pick an appropriate color. Custom objects can implement this interface to provide their own debug visualization.

Methods

getDebugX()

public float getDebugX()

X position of the bounding box in world space.


getDebugY()

public float getDebugY()

Y position of the bounding box in world space.


getDebugWidth()

public float getDebugWidth()

Width of the bounding box in world pixels.


getDebugHeight()

public float getDebugHeight()

Height of the bounding box in world pixels.


getDebugDrawX(FlixelCamera)

public default float getDebugDrawX(FlixelCamera camera)

X position of the debug box in the same world space as FlixelCamera projection during draw (includes scroll-factor / parallax). Defaults to FlixelDebugDrawable.getDebugX().

Parameters:

NameDescription
cameraThe game camera used for this debug pass.

getDebugDrawY(FlixelCamera)

public default float getDebugDrawY(FlixelCamera camera)

Y position of the debug box in the same world space as FlixelCamera projection during draw. Defaults to FlixelDebugDrawable.getDebugY().

Parameters:

NameDescription
cameraThe game camera used for this debug pass.

getDebugBoundingBoxColor()

public float[] getDebugBoundingBoxColor()

Returns the RGBA color for this object's debug bounding box as a 4-element array: [r, g, b, a]. Implementations should return a cached array rather than allocating every frame.