Beispiel #1
0
 //Allow for post-component rendering layout
 public virtual void PostLayout(
     bool IsTall,
     Grid grid,
     Controller GameController,
     IPlatformFoundry GameFoundry,
     IPage SourcePage
     )
 {
     /*
      * Gauge nit = new Gauge()
      * {
      *  Min = 0,
      *  Max = 24,
      *  Value = (float)(GameController.CurrentState.Player.HoursIntoDay)
      * };
      *
      * SKCanvasView vvr = new SKCanvasView();
      * nit.ConnectCanvasView(vvr);
      * grid.Children.Add(vvr, 25, 29, 0 ,4);
      */
     /*
      * ImageText cnit = new ImageText(GameController.CurrentState.Player.Energy.ToString());
      *
      * SKCanvasView cvvr = new SKCanvasView();
      * cnit.ConnectCanvasView(cvvr);
      * grid.Children.Add(cvvr, 0, 6, 4, 6);
      */
     //UpdaterHook
 }
Beispiel #2
0
 // Allow for pre-component rendering layout
 public override void PreLayout(
     bool IsTall,
     Grid grid,
     Controller GameController,
     IPlatformFoundry GameFoundry,
     IPage SourcePage
     )
 {
     return;
 }
Beispiel #3
0
        //Allow for post-component rendering layout
        public override void PostLayout(
            bool IsTall,
            Grid grid,
            Controller GameController,
            IPlatformFoundry GameFoundry,
            IPage CurrentPage
            )
        {
            Player PC = GameController.CurrentState.Player;

            if (IsTall)
            {
                grid.Children.Add(FlOval.AsView(),
                                  0, grid.ColumnDefinitions.Count,
                                  0, grid.RowDefinitions.Count);
                Food f = FindFood("Mexican Rice", GameController);

                List <string> Ingredients = new List <string>()
                {
                    "1 Medium tomato",
                    "1/4 small onion",
                    "1 cup rice",
                    "1 clove garlic",
                    "2 tbsp corn oil",
                    "2 cups water"
                };
                List <string> Steps = new List <string>()
                {
                    "Mince the tomato, garlic, and onion",
                    "Put pot on stove over medium heat",
                    "Once pot is hot, add oil",
                    "Once oil is hot, add rice",
                    "Stir rice constantly until toasted (not burnt)",
                    "Add the vegetables to the rice and stir, then add the water and stir",
                    "Add salt and pepper to taste",
                    "Once water starts to boil, turn heat to low and put lid on pot. Wait ~20 minutes, or until water is almost all absorbed",
                    "Remove from heat and rest 5 minutes",
                    "Fluff with spoon and serve!"
                };
                grid.Children.Add(ImageText.AsView(f.Name),
                                  0, grid.ColumnDefinitions.Count,
                                  2, 4);



                for (int i = 0; i < Ingredients.Count; ++i)
                {
                    int VShift = 1 * (int)(i / 2);
                    int Shift  = (i % 2) * grid.ColumnDefinitions.Count / 2 + 3 * (1 - (i % 2));
                    grid.Children.Add(ImageText.AsView(
                                          Ingredients[i],
                                          32f,
                                          ImageText.WrapType.Shrink,
                                          ImageText.HorizontalAlignment.Left
                                          ),
                                      Shift, grid.ColumnDefinitions.Count / 2 + Shift,
                                      7 + VShift, 9 + VShift);
                }


                String StepCounts = "1.\n2.\n3.\n4.\n5.\n\n6.\n\n7.\n8.\n\n\n\n9.\n10.\n";

                grid.Children.Add(
                    ImageText.AsView(
                        string.Join("\n", StepCounts),
                        32f,
                        ImageText.WrapType.WordWrap,
                        ImageText.HorizontalAlignment.Left),
                    3, grid.ColumnDefinitions.Count - 1,
                    (int)(6 + Ingredients.Count / 2), grid.RowDefinitions.Count - 1);

                grid.Children.Add(
                    ImageText.AsView(
                        string.Join("\n", Steps),
                        32f,
                        ImageText.WrapType.WordWrap,
                        ImageText.HorizontalAlignment.Left),
                    5, grid.ColumnDefinitions.Count,
                    (int)(6 + Ingredients.Count / 2), grid.RowDefinitions.Count - 1);

                int TX1 = 10;
                int TX2 = 15;
                int BR1 = TX2;
                int BR2 = 27;
                grid.Children.Add(FoodPic(f), 2, 11, 4, 7);
                // Calories
                grid.Children.Add(ImageText.AsView("Calories", 24f, ImageText.WrapType.Shrink), TX1, TX2, 4, 5);
                View CalorieView = ImageGradient.AsView(
                    0,
                    2000,
                    4000,
                    325.5985,
                    true,
                    false
                    );

                grid.Children.Add(CalorieView, BR1, BR2, 4, 5);
                SortedDictionary <float, SKColor> WhiteBar = new SortedDictionary <float, SKColor>()
                {
                    { 0f, new SKColor(255, 255, 255, 60) },
                    { 1f, new SKColor(255, 255, 255, 60) },
                };
                SortedDictionary <float, SKColor> MicroNutrients = new SortedDictionary <float, SKColor>();
                SortedDictionary <float, SKColor> MicroPotential = new SortedDictionary <float, SKColor>();
                SortedDictionary <float, SKColor> MacroNutrients = new SortedDictionary <float, SKColor>();
                float microNut = 0f;
                float microPot = 0f;
                float macroNut = 0f;

                foreach (KeyValuePair <Nutrient, NutrientAmount> kvp in f.Nutrients)
                {
                    FlorineSkiaNutrient AdjNut = new FlorineSkiaNutrient(kvp.Key);
                    float curRatio             = kvp.Key.RatioRDV(kvp.Value);

                    switch (kvp.Key.Class)
                    {
                    case Nutrient.NutrientType.Macro:
                        if (curRatio > 2f)
                        {
                            curRatio = 2f;
                        }
                        if (curRatio <= 0f)
                        {
                            continue;
                        }
                        curRatio /= 8f;
                        macroNut += curRatio;
                        MacroNutrients.Add(macroNut, AdjNut.RingColor);
                        break;

                    case Nutrient.NutrientType.Mineral:
                    case Nutrient.NutrientType.Vitamin:
                        if (curRatio > 1f)
                        {
                            curRatio = 1f;
                        }
                        float fRestRatio = float.NaN;
                        if (curRatio < 1f)
                        {
                            fRestRatio  = 1f - curRatio;
                            fRestRatio /= 7f;
                        }
                        curRatio /= 7f;
                        microPot += 1f / 7f;

                        if (curRatio > float.Epsilon)
                        {
                            microNut += curRatio;
                            MicroNutrients.Add(microNut, AdjNut.RingColor);
                        }
                        if (!float.IsNaN(fRestRatio))
                        {
                            microNut += fRestRatio;
                            MicroNutrients.Add(microNut, SKColors.Transparent);
                        }
                        SKColor newCol = new SKColor(
                            AdjNut.RingColor.Red,
                            AdjNut.RingColor.Green,
                            AdjNut.RingColor.Blue,
                            80
                            );
                        MicroPotential.Add(microPot, newCol);
                        break;
                    }
                }
                grid.Children.Add(ImageText.AsView("Vitamins", 24f, ImageText.WrapType.Shrink), TX1, TX2, 5, 6);


                grid.Children.Add(ImageGradient.AsDivBar(WhiteBar), BR1, BR2, 5, 6);
                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential), BR1, BR2, 5, 6);
                float gridSize = 5;
                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential,
                                                         new SKPaint()
                {
                    PathEffect = SKPathEffect.Create2DLine(1,
                                                           MatrixMultiply(SKMatrix.MakeScale(gridSize, gridSize),
                                                                          SKMatrix.MakeRotationDegrees(45))),
                    Style       = SKPaintStyle.Stroke,
                    StrokeWidth = 1,
                    Color       = new SKColor(0, 0, 0, 20)
                }), BR1, BR2, 5, 6);

                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential,
                                                         new SKPaint()
                {
                    PathEffect = SKPathEffect.Create2DLine(1,
                                                           MatrixMultiply(SKMatrix.MakeScale(gridSize, gridSize),
                                                                          SKMatrix.MakeRotationDegrees(-45))),
                    Style       = SKPaintStyle.Stroke,
                    StrokeWidth = 1,
                    Color       = new SKColor(0, 0, 0, 20)
                }), BR1, BR2, 5, 6);

                grid.Children.Add(ImageGradient.AsDivBar(MicroNutrients), BR1, BR2, 5, 6);


                grid.Children.Add(ImageText.AsView("Nutrients", 24f, ImageText.WrapType.Shrink), TX1, TX2, 6, 7);
                grid.Children.Add(ImageGradient.AsDivBar(MacroNutrients), BR1, BR2, 6, 7);
            }

            base.PostLayout(IsTall, grid, GameController, GameFoundry, CurrentPage);
            return;
        }
Beispiel #4
0
        //Allow for post-component rendering layout
        public override void PostLayout(
            bool IsTall,
            Grid grid,
            Controller GameController,
            IPlatformFoundry GameFoundry,
            IPage CurrentPage
            )
        {
            Player PC = GameController.CurrentState.Player;

            if (IsTall)
            {
                // Calories
                grid.Children.Add(_Text("Calories"), 15, 20, 4, 6);
                View CalorieView = ImageGradient.AsView(
                    0,
                    PC.TargetCalories,
                    PC.TargetCalories * 2,
                    PC.Calories,
                    true,
                    false
                    );

                grid.Children.Add(CalorieView, 20, 29, 4, 6);
                SortedDictionary <float, SKColor> WhiteBar = new SortedDictionary <float, SKColor>()
                {
                    { 0f, new SKColor(255, 255, 255, 60) },
                    { 1f, new SKColor(255, 255, 255, 60) },
                };
                SortedDictionary <float, SKColor> MicroNutrients = new SortedDictionary <float, SKColor>();
                SortedDictionary <float, SKColor> MicroPotential = new SortedDictionary <float, SKColor>();
                SortedDictionary <float, SKColor> MacroNutrients = new SortedDictionary <float, SKColor>();
                float microNut = 0f;
                float microPot = 0f;
                float macroNut = 0f;
                foreach (KeyValuePair <Nutrient, NutrientAmount> kvp in PC.Nutrients)
                {
                    FlorineSkiaNutrient AdjNut = new FlorineSkiaNutrient(kvp.Key);
                    float curRatio             = kvp.Key.RatioRDV(kvp.Value);

                    switch (kvp.Key.Class)
                    {
                    case Nutrient.NutrientType.Macro:
                        if (curRatio > 2f)
                        {
                            curRatio = 2f;
                        }
                        if (curRatio <= 0f)
                        {
                            continue;
                        }
                        curRatio /= 8f;
                        macroNut += curRatio;
                        MacroNutrients.Add(macroNut, AdjNut.RingColor);
                        break;

                    case Nutrient.NutrientType.Mineral:
                    case Nutrient.NutrientType.Vitamin:
                        if (curRatio > 1f)
                        {
                            curRatio = 1f;
                        }
                        float fRestRatio = float.NaN;
                        if (curRatio < 1f)
                        {
                            fRestRatio  = 1f - curRatio;
                            fRestRatio /= 7f;
                        }
                        curRatio /= 7f;
                        microPot += 1f / 7f;

                        if (curRatio > float.Epsilon)
                        {
                            microNut += curRatio;
                            MicroNutrients.Add(microNut, AdjNut.RingColor);
                        }
                        if (!float.IsNaN(fRestRatio))
                        {
                            microNut += fRestRatio;
                            MicroNutrients.Add(microNut, SKColors.Transparent);
                        }
                        SKColor newCol = new SKColor(
                            AdjNut.RingColor.Red,
                            AdjNut.RingColor.Green,
                            AdjNut.RingColor.Blue,
                            80
                            );
                        MicroPotential.Add(microPot, newCol);
                        break;
                    }
                }
                grid.Children.Add(_Text("Vitamins"), 15, 20, 6, 8);


                grid.Children.Add(ImageGradient.AsDivBar(WhiteBar), 20, 29, 6, 8);
                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential), 20, 29, 6, 8);
                float gridSize = 5;
                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential,
                                                         new SKPaint()
                {
                    PathEffect = SKPathEffect.Create2DLine(1,
                                                           MatrixMultiply(SKMatrix.MakeScale(gridSize, gridSize),
                                                                          SKMatrix.MakeRotationDegrees(45))),
                    Style       = SKPaintStyle.Stroke,
                    StrokeWidth = 1,
                    Color       = new SKColor(0, 0, 0, 20)
                }), 20, 29, 6, 8);

                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential,
                                                         new SKPaint()
                {
                    PathEffect = SKPathEffect.Create2DLine(1,
                                                           MatrixMultiply(SKMatrix.MakeScale(gridSize, gridSize),
                                                                          SKMatrix.MakeRotationDegrees(-45))),
                    Style       = SKPaintStyle.Stroke,
                    StrokeWidth = 1,
                    Color       = new SKColor(0, 0, 0, 20)
                }), 20, 29, 6, 8);

                grid.Children.Add(ImageGradient.AsDivBar(MicroNutrients), 20, 29, 6, 8);


                grid.Children.Add(_Text("Nutrients"), 15, 20, 8, 10);
                grid.Children.Add(ImageGradient.AsDivBar(MacroNutrients), 20, 29, 8, 10);

                int EnergyY = 20;
                int FocusY  = EnergyY + 3;
                if (CurrentPage.SubType != GameState.PageSubType.Dinner)
                {
                    grid.Children.Add(_Text("Energy"), 15, 20, EnergyY, EnergyY + 2);
                    grid.Children.Add(
                        ImageGradient.AsView(
                            0.0,
                            100.0,
                            100.0,
                            PC.Energy,
                            false,
                            true
                            ),
                        20, 29, EnergyY, EnergyY + 2
                        );

                    grid.Children.Add(_Text("Focus"), 15, 20, FocusY, FocusY + 2);
                    grid.Children.Add(
                        ImageGradient.AsView(
                            0.0,
                            100.0,
                            100.0,
                            PC.Focus,
                            false,
                            true
                            ),
                        20, 29, FocusY, FocusY + 2
                        );
                }
            }

            base.PostLayout(IsTall, grid, GameController, GameFoundry, CurrentPage);
            return;
        }
Beispiel #5
0
 public override void PostLayout(bool IsTall, Grid grid, Controller GameController, IPlatformFoundry GameFoundry, IPage SourcePage)
 {
     if (null != Description)
     {
         grid.Children.Add(Description, 12, 29, 17, 27);
     }
     base.PostLayout(IsTall, grid, GameController, GameFoundry, SourcePage);
 }
Beispiel #6
0
        public override void PreLayout(bool IsTall, Grid grid, Controller GameController, IPlatformFoundry GameFoundry, IPage SourcePage)
        {
            SKCanvasView Back = new SKCanvasView();

            Back.PaintSurface += Back_PaintSurface;
            grid.Children.Add(
                Back,
                0,
                grid.ColumnDefinitions.Count,
                0,
                grid.RowDefinitions.Count);
            base.PreLayout(IsTall, grid, GameController, GameFoundry, SourcePage);
        }
        public override void PostLayout(bool IsTall, Grid grid, Controller GameController, IPlatformFoundry GameFoundry, IPage SourcePage)
        {
            Player PC = GameController.CurrentState.Player;

            // Calories
            if (GameController.GetCurrentPage().SubType == GameState.PageSubType.Dinner)
            {
                grid.Children.Add(_Text("Calories"), 1, 10, 4, 6);
                View CalorieView = ImageGradient.AsView(
                    0,
                    PC.TargetCalories,
                    PC.TargetCalories * 2,
                    PC.Calories,
                    true,
                    false
                    );

                grid.Children.Add(CalorieView, 10, 29, 4, 6);

                SortedDictionary <float, SKColor> MicroNutrients = new SortedDictionary <float, SKColor>();
                SortedDictionary <float, SKColor> MicroPotential = new SortedDictionary <float, SKColor>();
                SortedDictionary <float, SKColor> MacroNutrients = new SortedDictionary <float, SKColor>();
                float microNut = 0f;
                float microPot = 0f;
                float macroNut = 0f;
                foreach (KeyValuePair <Nutrient, NutrientAmount> kvp in PC.Nutrients)
                {
                    FlorineSkiaNutrient AdjNut = new FlorineSkiaNutrient(kvp.Key);
                    float curRatio             = kvp.Key.RatioRDV(kvp.Value);

                    switch (kvp.Key.Class)
                    {
                    case Nutrient.NutrientType.Macro:
                        if (curRatio > 2f)
                        {
                            curRatio = 2f;
                        }
                        if (curRatio <= 0f)
                        {
                            continue;
                        }
                        curRatio /= 8f;
                        macroNut += curRatio;
                        MacroNutrients.Add(macroNut, AdjNut.RingColor);
                        break;

                    case Nutrient.NutrientType.Mineral:
                    case Nutrient.NutrientType.Vitamin:
                        if (curRatio > 1f)
                        {
                            curRatio = 1f;
                        }
                        float fRestRatio = float.NaN;
                        if (curRatio < 1f)
                        {
                            fRestRatio  = 1f - curRatio;
                            fRestRatio /= 7f;
                        }
                        curRatio /= 7f;
                        microPot += 1f / 7f;

                        if (curRatio > float.Epsilon)
                        {
                            microNut += curRatio;
                            MicroNutrients.Add(microNut, AdjNut.RingColor);
                        }
                        if (!float.IsNaN(fRestRatio))
                        {
                            microNut += fRestRatio;
                            MicroNutrients.Add(microNut, SKColors.Transparent);
                        }
                        SKColor newCol = new SKColor(
                            AdjNut.RingColor.Red,
                            AdjNut.RingColor.Green,
                            AdjNut.RingColor.Blue,
                            80
                            );
                        MicroPotential.Add(microPot, newCol);
                        break;
                    }
                }
                grid.Children.Add(_Text("Vitamins"), 1, 10, 6, 8);
                //grid.Children.Add(ImageGradient.AsDivBar(WhiteBar), 20, 29, 6, 8);
                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential), 10, 29, 6, 8);
                float gridSize = 5;
                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential,
                                                         new SKPaint()
                {
                    PathEffect = SKPathEffect.Create2DLine(1,
                                                           MatrixMultiply(SKMatrix.MakeScale(gridSize, gridSize),
                                                                          SKMatrix.MakeRotationDegrees(45))),
                    Style       = SKPaintStyle.Stroke,
                    StrokeWidth = 1,
                    Color       = new SKColor(0, 0, 0, 20)
                }), 10, 29, 6, 8);

                grid.Children.Add(ImageGradient.AsDivBar(MicroPotential,
                                                         new SKPaint()
                {
                    PathEffect = SKPathEffect.Create2DLine(1,
                                                           MatrixMultiply(SKMatrix.MakeScale(gridSize, gridSize),
                                                                          SKMatrix.MakeRotationDegrees(-45))),
                    Style       = SKPaintStyle.Stroke,
                    StrokeWidth = 1,
                    Color       = new SKColor(0, 0, 0, 20)
                }), 10, 29, 6, 8);
                grid.Children.Add(ImageGradient.AsDivBar(MicroNutrients), 10, 29, 6, 8);

                grid.Children.Add(_Text("Nutrients"), 1, 10, 8, 10);
                grid.Children.Add(ImageGradient.AsDivBar(MacroNutrients), 10, 29, 8, 10);
            }

            if (GameController.GetCurrentPage().SubType == GameState.PageSubType.Lunch)
            {
                IGameOptionSet iActivities = GameController.GetCurrentPage().AppliedOptions;
                int            Amount      = 0;
                foreach (IGameOption act in iActivities)
                {
                    Activity mainAct = act as Activity;
                    if (null != mainAct)
                    {
                        Amount += mainAct.Pay;
                    }
                    if (null != act.SubOptions)
                    {
                        foreach (IGameOption subopt in act.SubOptions)
                        {
                            Activity subAct = subopt as Activity;
                            if (subAct != null)
                            {
                                Amount += subAct.Pay;
                            }
                        }
                    }
                }

                if (Amount != 0)
                {
                    View moneyGrid = MoneyView.RenderView(Amount);
                    grid.Children.Add(moneyGrid, 10, 20, 15, 18);
                }
            }
            else if (GameController.GetCurrentPage().SubType == GameState.PageSubType.Dinner)
            {
                View BackView = new FlorineSkiaCVWrap(new FlOval()
                {
                    backgroundColor = new SKPaint()
                    {
                        Color = new SKColor(0, 80, 190, 230)
                    },
                    Shape          = FlOval.OvalType.Rectangle,
                    ovalRatio      = float.NaN,
                    innerHighlight = new SKColor(100, 250, 250, 255),
                });
                View moneyGrid     = MoneyView.RenderView(PC.Money, false);
                View HappinessGrid = Happiness.RenderView(PC.Happiness, false);
                View TotalText     = new FlorineSkiaCVWrap(new ImageText("Total")
                {
                    FontSize = 48f, Overflow = ImageText.WrapType.None
                });


                View tdBackView = new FlorineSkiaCVWrap(new FlOval()
                {
                    backgroundColor = new SKPaint()
                    {
                        Color = new SKColor(0, 80, 190, 230)
                    },
                    Shape          = FlOval.OvalType.Rectangle,
                    ovalRatio      = float.NaN,
                    innerHighlight = new SKColor(100, 250, 250, 255),
                });
                View tdmoneyGrid     = MoneyView.RenderView(PC.MoneyToDate, false);
                View tdHappinessGrid = Happiness.RenderView(PC.HappinessToDate, false);
                View tdTotalText     = new FlorineSkiaCVWrap(new ImageText("Today")
                {
                    FontSize = 48f, Overflow = ImageText.WrapType.None
                });

                int TotalY = 13;
                int TodayY = 10;
                //grid.Children.Add(BackView, 0, 30, 10, 14);
                grid.Children.Add(TotalText, 2, 9, TotalY + 1, TotalY + 3);
                grid.Children.Add(moneyGrid, 8, 17, TotalY, TotalY + 3);
                grid.Children.Add(HappinessGrid, 17, 28, TotalY, TotalY + 3);

                //grid.Children.Add(tdBackView, 0, 30, 14, 18);
                grid.Children.Add(tdTotalText, 2, 9, TodayY + 1, TodayY + 3);
                grid.Children.Add(tdmoneyGrid, 8, 17, TodayY, TodayY + 3);
                grid.Children.Add(tdHappinessGrid, 17, 28, TodayY, TodayY + 3);
            }

            int EnergyY = 20;
            int FocusY  = EnergyY + 3;

            grid.Children.Add(_Text("Energy"), 15, 20, EnergyY, EnergyY + 2);
            grid.Children.Add(
                ImageGradient.AsView(
                    0.0,
                    100.0,
                    100.0,
                    PC.Energy,
                    false,
                    true
                    ),
                20, 29, EnergyY, EnergyY + 2
                );

            grid.Children.Add(_Text("Focus"), 15, 20, FocusY, FocusY + 2);
            grid.Children.Add(
                ImageGradient.AsView(
                    0.0,
                    100.0,
                    100.0,
                    PC.Focus,
                    false,
                    true
                    ),
                20, 29, FocusY, FocusY + 2
                );

            base.PostLayout(IsTall, grid, GameController, GameFoundry, SourcePage);
        }
        public override void PreLayout(bool IsTall, Grid grid, Controller GameController, IPlatformFoundry GameFoundry, IPage SourcePage)
        {
            if (SourcePage.SubType == GameState.PageSubType.Dinner)
            {
                SKCanvasView Back = new SKCanvasView();
                Back.PaintSurface += Back_PaintSurface;
                XBG = Back;
            }

            base.PreLayout(IsTall, grid, GameController, GameFoundry, SourcePage);
        }
Beispiel #9
0
 public Controller(IPlatformFoundry foundry)
 {
     _foundry = foundry;
     _context = _foundry.LoadGameState();
 }
Beispiel #10
0
 //public class ComponentSelector
 public override void PreLayout(bool IsTall, Grid grid, Controller GameController, IPlatformFoundry GameFoundry, IPage SourcePage)
 {
     BodyLookups[ActiveBodyType] = GameController.CurrentState.Player.Avatar.Picture as PlayerAvatar;
     base.PostLayout(IsTall, grid, GameController, GameFoundry, SourcePage);
 }
Beispiel #11
0
        public override void PostLayout(bool IsTall, Grid grid, Controller GameController, IPlatformFoundry GameFoundry, IPage SourcePage)
        {
            ActualPlayerBase = GameController.CurrentState.Player;
            ActualPlayer     = GameController.CurrentState.Player.Avatar.Picture as PlayerAvatar;
            Entry NameEntry = new Entry()
            {
                Text = "Faerina",
                HorizontalTextAlignment = TextAlignment.Center,
//                FontSize = 8f,
                VerticalOptions = new LayoutOptions()
                {
                    Alignment = LayoutAlignment.End
                },
            };

            NameEntry.TextChanged += NameEntry_TextChanged;
            grid.Children.Add(NameEntry, 0, 30, 0, 4);
            SKPointI ClothesStart = new SKPointI(5, 22);
            SKPointI WingStart    = new SKPointI(15, 16);
            SKPointI HairStart    = new SKPointI(5, 16);
            SKPointI FaceStart    = new SKPointI(15, 22);

            OvalLookup["Box"] = OvalT(0, 0, 200, 120, 2f);
            OvalLookup["Box"].Item2.innerHighlight = new SKColor(100, 250, 250, 255);
            OvalLookup["Pear"]  = OvalT(0, 0, 200, 120, 2f);
            OvalLookup["Round"] = OvalT(0, 0, 200, 120, 2f);
            grid.Children.Add(OvalLookup["Pear"].Item1, 0, 10, 2, 15);
            grid.Children.Add(OvalLookup["Box"].Item1, 10, 20, 2, 15);
            grid.Children.Add(OvalLookup["Round"].Item1, 20, 30, 2, 15);
            grid.Children.Add(ColorSelector("body", new SKColor[] {
                new SKColor(253, 196, 179), // 1
                new SKColor(245, 185, 158), // 2
                new SKColor(228, 131, 86),  // 3
                new SKColor(217, 118, 76),  // 4
                new SKColor(182, 88, 34),   // 5
                new SKColor(143, 70, 29),   // 6
                new SKColor(113, 50, 20),   // 6
            }), 4, 26, 14, 16);

            grid.Children.Add(Oval(0, 0, 200, 120, 1f), ClothesStart.X, ClothesStart.X + 10, ClothesStart.Y, ClothesStart.Y + 6);
            grid.Children.Add(Oval(0, 0, 200, 120, 1f), WingStart.X, WingStart.X + 10, WingStart.Y, WingStart.Y + 6);
            grid.Children.Add(Oval(0, 0, 200, 120, 1f), HairStart.X, HairStart.X + 10, HairStart.Y, HairStart.Y + 6);

            grid.Children.Add(SetupSelector("clothes"), ClothesStart.X, ClothesStart.X + 10, ClothesStart.Y, ClothesStart.Y + 6);
            grid.Children.Add(SetupSelector("wings"), WingStart.X, WingStart.X + 10, WingStart.Y, WingStart.Y + 6);
            grid.Children.Add(SetupSelector("hair"), HairStart.X, HairStart.X + 10, HairStart.Y, HairStart.Y + 6);
            grid.Children.Add(ColorSelector("hair", new SKColor[] {
                new SKColor(202, 191, 177),
                new SKColor(255, 208, 115, 120),
                new SKColor(255, 240, 225),
            }), 1, 6, HairStart.Y + 1, HairStart.Y + 2);//21, 29, 22, 23);
            grid.Children.Add(ColorSelector("hair", new SKColor[] {
                new SKColor(230, 206, 168),
                new SKColor(222, 188, 153),
                new SKColor(143, 70, 29),
            }), 1, 6, HairStart.Y + 2, HairStart.Y + 3);//21, 29, 22, 23);

            grid.Children.Add(ColorSelector("hair", new SKColor[] {
                new SKColor(106, 78, 66),
                new SKColor(83, 61, 53),
                new SKColor(9, 8, 6),
            }), 1, 6, HairStart.Y + 3, HairStart.Y + 4);//21, 29, 22, 23);

            grid.Children.Add(ColorSelector("hair", new SKColor[] {
                new SKColor(145, 75, 67),
                new SKColor(181, 82, 57),
                new SKColor(205, 75, 67)
            }), 1, 6, HairStart.Y + 4, HairStart.Y + 5);//21, 29, 22, 23);


            grid.Children.Add(Oval(0, 0, 200, 120, 1f), FaceStart.X, FaceStart.X + 10, FaceStart.Y, FaceStart.Y + 6);
            grid.Children.Add(SetupSelector("face"), FaceStart.X, FaceStart.X + 10, FaceStart.Y, FaceStart.Y + 6);
            UpdateRefColor("body", PaintFor(new SKColor(217, 118, 76)));
            UpdateRefColor("hair", PaintFor(new SKColor(83, 61, 53)));
            //
            FlorineSkiaCVWrap PearView  = new FlorineSkiaCVWrap(BodyLookups["Pear"]);
            FlorineSkiaCVWrap RoundView = new FlorineSkiaCVWrap(BodyLookups["Round"]);

            BodyViews.Add(PlayerView);
            BodyViews.Add(PearView);
            BodyViews.Add(RoundView);

            //innerHighlight = new SKColor(100, 250, 250, 255),

            grid.Children.Add(PlayerView, 11, 19, 3, 14);
            grid.Children.Add(PearView, 1, 9, 3, 14);
            grid.Children.Add(RoundView, 21, 29, 3, 14);

            FlorineSkiaTapWrap.Associate(PlayerView, BoxSelect);
            FlorineSkiaTapWrap.Associate(PearView, PearSelect);
            FlorineSkiaTapWrap.Associate(RoundView, RoundSelect);
            //FlorineSkiaTapWrap.Associate(OvalLookup["Box"].Item1, BoxSelect);
            //FlorineSkiaTapWrap.Associate(OvalLookup["Pear"].Item1, PearSelect);
            //FlorineSkiaTapWrap.Associate(OvalLookup["Round"].Item1, RoundSelect);
        }