Table of Contents

Class OnixEventRendering

Namespace
OnixRuntime.Api.Events
Assembly
OnixRuntime.dll

Provides rendering-related events (world, HUD, screen rendering, 2D/Direct2D hooks). Subscribe to the events to receive renderer objects and timing deltas. Handlers are invoked with an appropriate renderer instance depending on the current rendering backend.

public class OnixEventRendering
Inheritance
OnixEventRendering
Inherited Members

Events

HudRender

This event is called when on hud, hide hud is false and there is no client UI screen opened. This will be called from the user's preferred 2D renderer. This may or may not be a logic callback so don't access game state, entities, etc.

public event OnixEventRendering.OnHudRender2DDelegate? HudRender

Event Type

OnixEventRendering.OnHudRender2DDelegate

HudRenderGame

Called when HUD should be rendered via the game's renderer. Logic-safe: game state and entities are available.

public event OnixEventRendering.OnHudRenderDelegate? HudRenderGame

Event Type

OnixEventRendering.OnHudRenderDelegate

PreRenderScreenDirect2D

This event is called all the time. The Pre is before the client's screens are rendered, not the game's. You should avoid this if RenderHudDirect2D gives you what you need. debug_screen should always be there if you want to pick that one, otherwise you can ignore debug_screen and toast_screen to have just the main screen. This will never be a logic callback so don't access game state, entities, etc.

public event OnixEventRendering.OnPreRenderScreenDirect2DDelegate? PreRenderScreenDirect2D

Event Type

OnixEventRendering.OnPreRenderScreenDirect2DDelegate

PreRenderScreenGame

This event is called all the time. The Pre is before the client AND game's screens are rendered. You should avoid this if HudRenderGame gives you what you need. debug_screen should always be there if you want to pick that one, otherwise you can ignore debug_screen and toast_screen to have just the main screen. This is a logic callback so you can access game state, entities, etc.

public event OnixEventRendering.OnPreRenderScreenDelegate? PreRenderScreenGame

Event Type

OnixEventRendering.OnPreRenderScreenDelegate

RenderHudDirect2D

This event is called when on hud, hide hud is false and there is no client UI screen opened. This will be called from the user's preferred 2D renderer. This will never be a logic callback so don't access game state, entities, etc.

public event OnixEventRendering.OnRenderHudDirect2DDelegate? RenderHudDirect2D

Event Type

OnixEventRendering.OnRenderHudDirect2DDelegate

RenderScreen

This event is called all the time. You should avoid this if HudRender gives you what you need. This will be called from the user's preferred 2D renderer. This may or may not be a logic callback so don't access game state, entities, etc. There is no PreRenderScreen2D event, because depending on the renderer, pre means different things. You can handle this case manually by checking the different pre events and MainRenderer.

public event OnixEventRendering.OnRenderScreen2DDelegate? RenderScreen

Event Type

OnixEventRendering.OnRenderScreen2DDelegate

RenderScreenDirect2D

This event is called all the time. You should avoid this if RenderHudDirect2D gives you what you need. This will never be a logic callback so don't access game state, entities, etc.

public event OnixEventRendering.OnRenderScreenDirect2DDelegate? RenderScreenDirect2D

Event Type

OnixEventRendering.OnRenderScreenDirect2DDelegate

RenderScreenGame

This event is called all the time. (always logic-safe) This is a logic callback so you can access game state, entities, etc.

public event OnixEventRendering.OnRenderScreenDelegate? RenderScreenGame

Event Type

OnixEventRendering.OnRenderScreenDelegate

ShouldHideScreen

This is only for game screens, returning true will prevent that screen from rendering.

public event OnixEventRendering.ShouldHideScreenDelegate? ShouldHideScreen

Event Type

OnixEventRendering.ShouldHideScreenDelegate

WorldRender

Occurs when the world (3D) should be rendered. Handlers receive a RendererWorld and the frame delta.

public event OnixEventRendering.OnWorldRenderDelegate? WorldRender

Event Type

OnixEventRendering.OnWorldRenderDelegate