1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 14:35:45 +00:00

Générer

This commit is contained in:
Yan Maniez 2019-07-28 02:07:28 +02:00
parent f0d2fcd3aa
commit 6378717fe3
3 changed files with 14 additions and 4 deletions

View file

@ -8,7 +8,7 @@
<ContentPage.Content>
<StackLayout>
<StackLayout Orientation="Horizontal">
<Picker SelectedItem="{Binding Quantity, Mode=TwoWay}">
<!--<Picker SelectedItem="{Binding Quantity, Mode=TwoWay}">
<Picker.ItemsSource>
<x:Array Type="{x:Type x:Int32}">
<x:Int32>6</x:Int32>
@ -58,7 +58,7 @@
<x:Int32>-10</x:Int32>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Picker>-->
<!--<pickers:StringPickerView BindingContext="{Binding}" Title="{Binding PreferedBackgroundSpecialties.Name}" Description="{Binding PreferedBackgroundSpecialties.Description}" ItemsSource="{Binding PreferedBackgroundSpecialties.BindableTable}" SelectedItem="{Binding BackgroundSpecialty, Mode=TwoWay}" />
<pickers:StringPickerView BindingContext="{Binding}" Title="{Binding PreferedBackgroundSpecialties.Name}" Description="{Binding PreferedBackgroundSpecialties.Description}" ItemsSource="{Binding PreferedBackgroundSpecialties.BindableTable}" SelectedItem="{Binding BackgroundSpecialty, Mode=TwoWay}" />
<pickers:StringPickerView BindingContext="{Binding}" Title="{Binding PreferedBackgroundSpecialties.Name}" Description="{Binding PreferedBackgroundSpecialties.Description}" ItemsSource="{Binding PreferedBackgroundSpecialties.BindableTable}" SelectedItem="{Binding BackgroundSpecialty, Mode=TwoWay}" />-->
@ -68,6 +68,7 @@
</skviews:SKCanvasView>
<Button Text="Générer" Clicked="Button_Clicked"/>
<urho:UrhoSurface x:Name="HelloWorldUrhoSurface" VerticalOptions="FillAndExpand" />
</StackLayout>
</ContentPage.Content>

View file

@ -1,4 +1,6 @@
using AideDeJeu.ViewModels;
using OnePlat.DiceNotation;
using OnePlat.DiceNotation.DieRoller;
using SkiaSharp;
using System;
using System.Collections.Generic;
@ -8,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using Urho;
using Xamarin.Forms;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;
namespace AideDeJeu.Views
@ -82,11 +85,16 @@ namespace AideDeJeu.Views
strokeFont.Dispose();
strokePaint.Dispose();
}
Charts charts = null;
private async void ContentPage_Appearing(object sender, EventArgs e)
{
//await HelloWorldUrhoSurface.Show<HelloWorld>(new Urho.ApplicationOptions(assetsFolder: null));
await HelloWorldUrhoSurface.Show<Charts>(new Urho.ApplicationOptions(assetsFolder: null));
charts = await HelloWorldUrhoSurface.Show<Charts>(new Urho.ApplicationOptions(assetsFolder: null));
}
private void Button_Clicked(object sender, EventArgs e)
{
charts.Bars.ForEach(b => b.SetValueWithAnimation((new Dice()).Roll("3d6", new RandomDieRoller()).Value));
}
}
public class HelloWorld : Urho.Application

View file

@ -176,6 +176,7 @@ namespace AideDeJeu.Views
{
finalValue = value;
barNode.RunActionsAsync(new EaseBackOut(new ScaleTo(3f, 1, value / 2, 1)));
barNode.RunActionsAsync(new EaseBackOut(new TintTo(3f, new Color(1f - (((float)value - 3f) / 15f), (((float)value - 3f) / 15f), 0, 0.9f))));
}
public Bar(Color color)