Skip to content

UniRenderLayerRegistration

Backend-neutral handle for a registered render layer.

Overview

UniRenderLayerRegistration encapsulates a registered layer in the active backend. It allows dynamically enabling or disabling the layer, changing its z-priority, updating its visibility predicate, and cleanly unregistering it via close().

Lifecycle Management

Since UniRenderLayerRegistration implements AutoCloseable, it can be managed with try-with-resources or closed when a feature is toggled off, instantly unhooking both the backend registration and the layer itself.

Toggle and Unregister Layer

UniRenderLayerRegistration reg = UniHudRender.register(myWidget);
// Temporarily disable
reg.enabled(false);
// Later, permanently remove
reg.close();

API

UniRenderLayerRegistration::close()

close()

Unregisters and closes this layer from the backend.

UniRenderLayerRegistration::closed()

closed()

Returns true if this registration has been closed.

Returns boolean: True if closed..

UniRenderLayerRegistration::enabled()

enabled()

Returns true if this layer is currently enabled for rendering.

Returns boolean: True if enabled..

UniRenderLayerRegistration::enabled(boolean)

enabled(boolean)

Enables or disables rendering for this layer without unregistering.

Parameter Type Description
enabled boolean True to enable, false to disable.

Returns UniRenderLayerRegistration: This registration handle for chaining..

UniRenderLayerRegistration::layer()

layer()

Returns the underlying UniRenderLayer instance.

Returns UniRenderLayer: Associated UniRenderLayer..

UniRenderLayerRegistration::priority()

priority()

Returns the rendering order priority.

Returns int: Current priority integer..

UniRenderLayerRegistration::priority(int)

priority(int)

Updates the rendering order priority.

Parameter Type Description
priority int New priority integer.

Returns UniRenderLayerRegistration: This registration handle for chaining..

UniRenderLayerRegistration::visibleWhen(Predicate)

visibleWhen(Predicate)

Updates the dynamic visibility predicate.

Parameter Type Description
visibility Predicate Predicate testing context object.

Returns UniRenderLayerRegistration: This registration handle for chaining..