Sorry, there's nothing at this address.
10 |8 | Welcome to the PixiJS Examples page! Here you can find a variety of demos and code snippets to help you get started with PixiJS. 9 |
10 | 11 |Check out some of our featured examples below:
12 | 13 |
31 | @string.Join("\r\n", CompileLog)
32 |
33 | }
34 | else
35 | {
36 | Click 12 | Source: Bitmap Text Example 13 |
14 | 15 | 16 | @code { 17 | [Inject] 18 | BlazorJSRuntime JS { get; set; } 19 | ElementReference containerElRef; 20 | Application? app = null; 21 | protected override async Task OnAfterRenderAsync(bool firstRender) 22 | { 23 | if (firstRender) 24 | { 25 | await Init(); 26 | } 27 | } 28 | async Task Init() 29 | { 30 | using var document = JS.GetDocument(); 31 | 32 | // Create a new application 33 | app = new Application(); 34 | 35 | // Initialize the application 36 | await app.Init(new ApplicationOptions { Background = "#1099bb", ResizeTo = containerElRef }); 37 | 38 | // Append the application canvas to the document body 39 | using var htmlElement = new HTMLElement(containerElRef); 40 | htmlElement!.AppendChild(app.Canvas); 41 | 42 | await Assets.Load("https://pixijs.com/assets/bitmap-font/desyrel.xml"); 43 | 44 | var bitmapFontText = new BitmapText(new TextOptions 45 | { 46 | Text = "bitmap fonts are supported!\nWoo yay!", 47 | Style = new PIXI.TextStyleOptions 48 | { 49 | FontFamily = "Desyrel", 50 | FontSize = 55, 51 | Align = "left", 52 | }, 53 | }); 54 | 55 | bitmapFontText.X = 50; 56 | bitmapFontText.Y = 200; 57 | 58 | app.Stage!.AddChild(bitmapFontText); 59 | } 60 | public void Dispose() 61 | { 62 | if (app != null) 63 | { 64 | app.Dispose(); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /SpawnDev.BlazorJS.PixiJS/SpawnDev.BlazorJS.PixiJS.csproj: -------------------------------------------------------------------------------- 1 |10 | Source: Basic Container Example 11 |
12 | 13 |10 | Source: Blend Modes Example 11 |
12 | 13 |12 | Source: From Font Example 13 |
14 | 15 |12 | Source: Bitmap Text Example 13 |
14 | 15 |12 | Source: From Font Example 13 |
14 | 15 |