Skip to main content

FlixelDebugUtil

View source

class

org.flixelgdx.util.FlixelDebugUtil

public final class FlixelDebugUtil

Utility methods used by the debug overlay for recursively traversing the state's object tree (counting active members, iterating FlixelDebugDrawable instances for bounding-box drawing, etc.).

Recursion descends into any member that implements FlixelGroupable, which covers FlixelBasicGroup, FlixelSpriteGroup, and nested FlixelGroup instances whose elements are IFlixelBasic.

Methods

countActiveMembers()

public static int countActiveMembers()

Recursively counts all active members in the current state's object tree. A member is counted when IFlixelBasic.isExists() is true.

Returns: The number of active members, or 0 if no state is loaded.


forEachDebugDrawable(Consumer<FlixelDebugDrawable>)

public static void forEachDebugDrawable(Consumer<FlixelDebugDrawable> callback)

Iterates all visible FlixelDebugDrawable instances in the current state's object tree (where IFlixelBasic.isExists() and FlixelVisible.isVisible() are both true), invoking the callback for each one. No intermediate collection is created.

Parameters:

NameDescription
callbackInvoked once per visible FlixelDebugDrawable.