Class EntityDebugRendererExtensions
Adds the EntityDebugSceneRenderer to a GraphicsCompositor or a game.
public static class EntityDebugRendererExtensions
- Inheritance
-
EntityDebugRendererExtensions
Methods
AddEntityDebugRenderer(GraphicsCompositor, EntityDebugSceneRendererOptions?)
Adds an EntityDebugSceneRenderer to the GraphicsCompositor for rendering entity debug information.
public static GraphicsCompositor AddEntityDebugRenderer(this GraphicsCompositor graphicsCompositor, EntityDebugSceneRendererOptions? options = null)
Parameters
graphicsCompositorGraphicsCompositorThe GraphicsCompositor to which the entity debug renderer will be added.
optionsEntityDebugSceneRendererOptionsOptional settings to customize the appearance of the debug renderer. If not provided, default options will be used.
Returns
- GraphicsCompositor
The modified GraphicsCompositor instance with the entity debug renderer added.
Examples
The following example demonstrates how to add an entity debug renderer with default settings:
graphicsCompositor.AddEntityDebugRenderer();
You can also specify custom options:
var options = new EntityDebugSceneRendererOptions { FontSize = 16, FontColor = Color.Red };
graphicsCompositor.AddEntityDebugRenderer(options);
Remarks
This method adds a custom EntityDebugSceneRenderer to the graphics compositor, allowing the display of debug information
such as entity names and positions in a 3D scene. The renderer can be customized using the options parameter,
which allows the user to define font size, color, and other settings.
AddEntityDebugSceneRenderer(IGame, EntityDebugSceneRendererOptions?)
Adds an EntityDebugSceneRenderer to the game's GraphicsCompositor for rendering entity debug information.
public static EntityDebugSceneRenderer AddEntityDebugSceneRenderer(this IGame game, EntityDebugSceneRendererOptions? options = null)
Parameters
gameIGameThe Game instance to which the entity debug renderer will be added.
optionsEntityDebugSceneRendererOptionsOptional settings to customize the appearance of the debug renderer. If not provided, default options will be used.
Returns
- EntityDebugSceneRenderer
The renderer, already in the compositor.
Examples
The following example demonstrates how to add an entity debug renderer with default settings:
game.AddEntityDebugSceneRenderer();
You can also specify custom options:
var options = new EntityDebugSceneRendererOptions { FontSize = 16, FontColor = Color.Red };
game.AddEntityDebugSceneRenderer(options);
Remarks
This method adds a custom EntityDebugSceneRenderer to the game's graphics compositor, allowing the display of debug information
such as entity names and positions in a 3D scene. The renderer can be customized using the options parameter,
which allows the user to define font size, color, and other settings.
IMPORTANT: This may significantly reduce frame rate. Use only for development or debugging, or in scenes with very few entities.
Exceptions
- InvalidOperationException
Thrown if the GraphicsCompositor is not set in the game's SceneSystem.