From c9d7fd29df7f08ffeedcc2a3b3e71a62d83102af Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 15 Sep 2024 23:01:37 +0200 Subject: [PATCH] added wip disclaimer to the web demo --- Demos.Web/Pages/Index.razor.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Demos.Web/Pages/Index.razor.cs b/Demos.Web/Pages/Index.razor.cs index d1cc4b0..bc1d1f7 100644 --- a/Demos.Web/Pages/Index.razor.cs +++ b/Demos.Web/Pages/Index.razor.cs @@ -2,13 +2,16 @@ using System.Threading.Tasks; using Microsoft.JSInterop; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; +using MLEM.Formatting; using MLEM.Misc; +using MLEM.Ui; +using MLEM.Ui.Elements; namespace Demos.Web.Pages; public partial class Index { - private Game game; + private GameImpl game; protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); @@ -21,6 +24,11 @@ public partial class Index { if (this.game == null) { MlemPlatform.Current = new MlemPlatform.DesktopGl((w, c) => w.TextInput += c); this.game = new GameImpl(); + this.game.OnLoadContent += g => g.UiSystem.Add("WebDisclaimer", new Paragraph(Anchor.BottomCenter, 1, "The Web version of MLEM's demos is still in development.\nFor the best experience, please try their Desktop and Android versions instead.") { + PositionOffset = new Vector2(0, 1), + Alignment = TextAlignment.Center, + TextScale = 0.075F + }); this.game.Run(); } this.game.Tick();