![]() |
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.
|
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...
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. | |
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.
| override void Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.Dispose | ( | ) |
Definition at line 165 of file BlazorBitmapRenderSurfaceComponent.razor.cs.
|
protected |
Definition at line 53 of file BlazorBitmapRenderSurfaceComponent.razor.cs.
| void Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceComponent.OnCanvasSizeChanged | ( | int | width, |
| int | height ) |
Updates the adapter after JavaScript observes a canvas client-size change.
| width | Canvas client width in CSS pixels. |
| height | Canvas client height in CSS pixels. |
Definition at line 106 of file BlazorBitmapRenderSurfaceComponent.razor.cs.
|
protected |
Definition at line 46 of file BlazorBitmapRenderSurfaceComponent.razor.cs.
|
get |
Gets the render surface adapter that drives this component.
Definition at line 34 of file BlazorBitmapRenderSurfaceComponent.razor.cs.
|
get |
Gets the RenderSurfaceHost<T> bound to this component.
Definition at line 37 of file BlazorBitmapRenderSurfaceComponent.razor.cs.