Class EntityInfoRendererExtensions
Adds the EntityInfoRenderer to a GraphicsCompositor or a game.
public static class EntityInfoRendererExtensions
- Inheritance
-
EntityInfoRendererExtensions
Methods
AddEntityInfoRenderer(IGame, EntityInfoRendererOptions?)
Adds an EntityInfoRenderer to the game's GraphicsCompositor for rendering entity debug information.
public static EntityInfoRenderer AddEntityInfoRenderer(this IGame game, EntityInfoRendererOptions? options = null)
Parameters
gameIGameThe Game instance to which the entity debug renderer will be added.
optionsEntityInfoRendererOptionsOptional settings to customize the appearance of the debug renderer. If not provided, default options will be used.
Returns
- EntityInfoRenderer
The renderer, already in the compositor.
Examples
The following example demonstrates how to add an entity debug renderer with default settings:
game.AddEntityInfoRenderer();
You can also specify custom options:
var options = new EntityInfoRendererOptions { FontSize = 16, FontColor = Color.Red };
game.AddEntityInfoRenderer(options);
Remarks
This method adds a custom EntityInfoRenderer 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.
AddEntityInfoRenderer(GraphicsCompositor, EntityInfoRendererOptions?)
Adds an EntityInfoRenderer to the GraphicsCompositor for rendering entity debug information.
public static GraphicsCompositor AddEntityInfoRenderer(this GraphicsCompositor graphicsCompositor, EntityInfoRendererOptions? options = null)
Parameters
graphicsCompositorGraphicsCompositorThe GraphicsCompositor to which the entity debug renderer will be added.
optionsEntityInfoRendererOptionsOptional 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.AddEntityInfoRenderer();
You can also specify custom options:
var options = new EntityInfoRendererOptions { FontSize = 16, FontColor = Color.Red };
graphicsCompositor.AddEntityInfoRenderer(options);
Remarks
This method adds a custom EntityInfoRenderer 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.