mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-30 15:06:06 +00:00
Hello world urho
This commit is contained in:
parent
d4bb055dad
commit
3e464f0516
2 changed files with 37 additions and 1 deletions
|
|
@ -3,7 +3,8 @@
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
xmlns:skviews="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms"
|
xmlns:skviews="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms"
|
||||||
xmlns:pickers="clr-namespace:AideDeJeu.Views.Pickers"
|
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">
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<StackLayout>
|
<StackLayout>
|
||||||
<StackLayout Orientation="Horizontal">
|
<StackLayout Orientation="Horizontal">
|
||||||
|
|
@ -66,6 +67,8 @@
|
||||||
<skviews:SKCanvasView x:Name="CanvasDices" Margin="15" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" PaintSurface="SKCanvasView_PaintSurface">
|
<skviews:SKCanvasView x:Name="CanvasDices" Margin="15" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" PaintSurface="SKCanvasView_PaintSurface">
|
||||||
|
|
||||||
</skviews:SKCanvasView>
|
</skviews:SKCanvasView>
|
||||||
|
|
||||||
|
<urho:UrhoSurface x:Name="HelloWorldUrhoSurface" VerticalOptions="FillAndExpand" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
|
|
@ -82,5 +82,38 @@ namespace AideDeJeu.Views
|
||||||
strokeFont.Dispose();
|
strokeFont.Dispose();
|
||||||
strokePaint.Dispose();
|
strokePaint.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void ContentPage_Appearing(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await HelloWorldUrhoSurface.Show<HelloWorld>(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue