Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent Class Referencesealed

A Blazor component that presents Gondwana game frames on an HTML <canvas> element and forwards keyboard, mouse, and touch events to the Gondwana input adapters. More...

Inheritance diagram for Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent:
Gondwana.Blazor.Rendering.BlazorRenderSurfaceComponentBase

Public Member Functions

void OnCanvasSizeChanged (int width, int height)
 Updates the adapter after JavaScript observes a canvas client-size change.
override void Dispose ()
Public Member Functions inherited from Gondwana.Blazor.Rendering.BlazorRenderSurfaceComponentBase
void Dispose ()
 Releases resources owned by the concrete render surface component.

Protected Member Functions

override void OnInitialized ()
override async Task OnAfterRenderAsync (bool firstRender)
Protected Member Functions inherited from Gondwana.Blazor.Rendering.BlazorRenderSurfaceComponentBase
override void OnParametersSet ()
void HandleKeyDown (KeyboardEventArgs e)
 Forwards a browser key-down event to registered input adapters.
void HandleKeyUp (KeyboardEventArgs e)
 Forwards a browser key-up event to registered input adapters.
void HandleMouseMove (MouseEventArgs e)
 Forwards a browser mouse-move event to registered input adapters.
void HandleMouseDown (MouseEventArgs e)
 Forwards a browser mouse-down event to registered input adapters.
void HandleMouseUp (MouseEventArgs e)
 Forwards a browser mouse-up event to registered input adapters.
void HandleWheel (WheelEventArgs e)
 Forwards a browser wheel event to registered input adapters.
Task HandleTouchStart (TouchEventArgs e)
 Forwards a browser touch-start event to registered input adapters.
Task HandleTouchMove (TouchEventArgs e)
 Forwards a browser touch-move event to registered input adapters.
Task HandleTouchEnd (TouchEventArgs e)
 Forwards a browser touch-end event to registered input adapters.
void HandleTouchCancel (TouchEventArgs e)
 Forwards a browser touch-cancel event to registered input adapters.

Properties

BlazorBitmapRenderSurfaceAdapter Adapter = null! [get]
 Gets the render surface adapter that drives this component.
RenderSurfaceHost< BitmapBackbuffer > Host = null! [get]
 Gets the RenderSurfaceHost<T> bound to this component.
Properties inherited from Gondwana.Blazor.Rendering.BlazorRenderSurfaceComponentBase
Dictionary< string, object >? AdditionalAttributes [get, set]
 Gets or sets additional attributes applied to the underlying HTML canvas element.
IReadOnlyDictionary< string, object >? CanvasAttributes [get]
 Gets the canvas attributes with the component-owned style attribute removed.
string CanvasStyle = DefaultCanvasStyle [get]
 Gets the effective canvas style, including Gondwana's required defaults.

Detailed Description

A Blazor component that presents Gondwana game frames on an HTML <canvas> element and forwards keyboard, mouse, and touch events to the Gondwana input adapters.

Place this component anywhere in your Blazor page layout and pass the instance to BlazorGameHost (from Gondwana.Blazor.Hosting) to wire up the engine lifecycle.

The component must be visible in the DOM before Initialize is called on the host, because rendering is initiated during OnAfterRenderAsync on the first render.

Keyboard events require the canvas to have focus. The component requests focus automatically on first render; games may also call element.focus() from JavaScript as needed.

Definition at line 26 of file BlazorBitmapRenderSurfaceComponent.razor.cs.

Member Function Documentation

◆ Dispose()

override void Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.Dispose ( )

Definition at line 165 of file BlazorBitmapRenderSurfaceComponent.razor.cs.

◆ OnAfterRenderAsync()

override async Task Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.OnAfterRenderAsync ( bool firstRender)
protected

Definition at line 53 of file BlazorBitmapRenderSurfaceComponent.razor.cs.

◆ OnCanvasSizeChanged()

void Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.OnCanvasSizeChanged ( int width,
int height )

Updates the adapter after JavaScript observes a canvas client-size change.

Parameters
widthCanvas client width in CSS pixels.
heightCanvas client height in CSS pixels.

Definition at line 106 of file BlazorBitmapRenderSurfaceComponent.razor.cs.

◆ OnInitialized()

override void Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.OnInitialized ( )
protected

Definition at line 46 of file BlazorBitmapRenderSurfaceComponent.razor.cs.

Property Documentation

◆ Adapter

BlazorBitmapRenderSurfaceAdapter Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.Adapter = null!
get

Gets the render surface adapter that drives this component.

Definition at line 34 of file BlazorBitmapRenderSurfaceComponent.razor.cs.

◆ Host

RenderSurfaceHost<BitmapBackbuffer> Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.Host = null!
get

Gets the RenderSurfaceHost<T> bound to this component.

Definition at line 37 of file BlazorBitmapRenderSurfaceComponent.razor.cs.