Blazorex 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blazorex --version 1.0.1                
NuGet\Install-Package Blazorex -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazorex" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazorex --version 1.0.1                
#r "nuget: Blazorex, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Blazorex as a Cake Addin
#addin nuget:?package=Blazorex&version=1.0.1

// Install Blazorex as a Cake Tool
#tool nuget:?package=Blazorex&version=1.0.1                

Blazorex

Description

Blazorex is an HTML Canvas wrapper library for Blazor.

Blazorex

It has some interesting functionalities like:

  • multiple canvases
  • background rendering
  • image rendering
  • procedural image generation (yes, the fire on the background is fully procedural! Thanks filipedeschamps for the awesome repository showing how to render the Doom fire! )

Installation

Blazorex can be installed as Nuget package: https://www.nuget.org/packages/Blazorex/

Usage

Simply add the Canvas Component to your Razor page and register to the OnCanvasReady to receive the CanvasBase instance.

Then use OnFrameReady to define your update/rendere logic:

<Canvas Width="800" Height="600" 
        OnFrameReady="(t) => OnFrameReady(t)"
        OnCanvasReady="(ctx) => OnCanvasReady(ctx)" />

@code{
    CanvasBase _canvas;

    private void OnCanvasReady(CanvasBase canvas)
    {
        _canvas = canvas;
    }

    private void OnFrameReady(float timeStamp)
    {
        // your render logic goes here
    }
}

You might also need to update your index.html to include the library's CSS:

<head>
    
    <link href="_content/Blazorex/blazorex.css" rel="stylesheet" />
</head>

For a complete sample, check the ./src/Blazorex.Web folder.

A sample game can be found here: Blazeroids

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 45 11/19/2024
1.1.0 104 9/25/2024
1.0.4 352 6/27/2024
1.0.3 238 12/31/2023
1.0.2 207 9/5/2023
1.0.1 220 6/13/2023
1.0.0 169 6/13/2023
0.0.5 521 10/3/2022
0.0.4 452 10/3/2022
0.0.3 440 9/19/2022
0.0.2 436 9/19/2022
0.0.1 453 9/19/2022