From 3e464f05160f6a5ce997e4ef4960e0460921e0e3 Mon Sep 17 00:00:00 2001 From: Yan Maniez Date: Sat, 27 Jul 2019 11:55:16 +0200 Subject: [PATCH] Hello world urho --- AideDeJeu/AideDeJeu/Views/DicesPage.xaml | 5 +++- AideDeJeu/AideDeJeu/Views/DicesPage.xaml.cs | 33 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/AideDeJeu/AideDeJeu/Views/DicesPage.xaml b/AideDeJeu/AideDeJeu/Views/DicesPage.xaml index 147db6be..b7b65f73 100644 --- a/AideDeJeu/AideDeJeu/Views/DicesPage.xaml +++ b/AideDeJeu/AideDeJeu/Views/DicesPage.xaml @@ -3,7 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:skviews="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms" xmlns:pickers="clr-namespace:AideDeJeu.Views.Pickers" - x:Class="AideDeJeu.Views.DicesPage"> + xmlns:urho="clr-namespace:Urho.Forms;assembly=UrhoSharp.Forms" + x:Class="AideDeJeu.Views.DicesPage" Appearing="ContentPage_Appearing"> @@ -66,6 +67,8 @@ + + \ No newline at end of file diff --git a/AideDeJeu/AideDeJeu/Views/DicesPage.xaml.cs b/AideDeJeu/AideDeJeu/Views/DicesPage.xaml.cs index 5735eba8..1a29a8c3 100644 --- a/AideDeJeu/AideDeJeu/Views/DicesPage.xaml.cs +++ b/AideDeJeu/AideDeJeu/Views/DicesPage.xaml.cs @@ -82,5 +82,38 @@ namespace AideDeJeu.Views strokeFont.Dispose(); strokePaint.Dispose(); } + + private async void ContentPage_Appearing(object sender, EventArgs e) + { + await HelloWorldUrhoSurface.Show(new Urho.ApplicationOptions(assetsFolder: null)); + } + } + public class HelloWorld : Urho.Application + { + public HelloWorld(Urho.ApplicationOptions options) : base(options) + { + + } + protected override void Start() + { + base.Start(); + CreateText(); + } + + private void CreateText() + { + // Create Text Element + var text = new Urho.Gui.Text() + { + Value = "Hello World!", + HorizontalAlignment = Urho.Gui.HorizontalAlignment.Center, + VerticalAlignment = Urho.Gui.VerticalAlignment.Center + }; + + text.SetColor(Urho.Color.Cyan); + text.SetFont(font: ResourceCache.GetFont("Fonts/Anonymous Pro.ttf"), size: 30); + // Add to UI Root + UI.Root.AddChild(text); + } } } \ No newline at end of file