Example #1
0
        private SKCanvasView FoodPic(Food food)
        {
            List <Tuple <float, SKColor> > MacroNuts = new List <Tuple <float, SKColor> >();
            List <Tuple <float, SKColor> > MicroNuts = new List <Tuple <float, SKColor> >();

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

                //45 * ((float)(kvp.Value) / (float)(kvp.Key.DailyTarget));
                //if (RelativeAmount > 45.0f) { RelativeAmount = 45.0f; }
                if (kvp.Key.Class == Nutrient.NutrientType.Macro)
                {
                    RelativeAmount *= 180f / 4f;
                    MacroNuts.Add(new Tuple <float, SKColor>(
                                      RelativeAmount,
                                      AdjNut.RingColor
                                      ));
                }
                else
                {
                    if (RelativeAmount > 1f)
                    {
                        RelativeAmount = 1f;
                    }
                    RelativeAmount *= 180 / 6f;
                    MicroNuts.Add(new Tuple <float, SKColor>(
                                      RelativeAmount,
                                      AdjNut.RingColor
                                      ));
                }
            }
            LayeredImage newImg = new LayeredImage()
            {
                Layers =
                {
                    new ImageText("Image Not Available")
                    {
                        Overflow = ImageText.WrapType.DiamondWrap, FontSize = 24f
                    },
                    new FlOval()
                    {
                        mainImage       = null,
                        backgroundColor = new SKPaint()
                        {
                            Color = new SKColor(230, 230, 230)
                        },
                        RightRing = MicroNuts,
                        LeftRing  = MacroNuts,
                    }
                }
            };

            return(new FlorineSkiaCVWrap(newImg));
        }
Example #2
0
        private IGameOption _renderOption(IGameOption opt, FlorineSkiaOptionSet Container)
        {
            FlorineSkiaOption newOpt = new FlorineSkiaOption(opt, Container);

            if (null != newOpt.SubOptions)
            {
                newOpt.SubOptions = _renderOptionSet(opt.SubOptions);
            }

            // Absurdly Hackity
            String pathType = "food";

            if (opt is Activity)
            {
                //Activity
                newOpt.Description       = ((Activity)opt).Description;
                Container.SelectionModel = FlorineSkiaOptionSet.SelectionType.SELECT_MOVE;
                pathType = "activities";
                string  tokenName   = opt.OptionName;
                SKImage ResultImage = ResourceLoader.LoadImage("Images/" + pathType + "/" + tokenName.ToLower() + ".png");
                newOpt.Picture = new SelectableOptionImage()
                {
                    FoodImage = ((null == ResultImage) ?
                                 (IFlorineSkiaDrawable)(new ImageText(tokenName))
                        : (IFlorineSkiaDrawable)(new FlOval()
                    {
                        mainImage = ResultImage,
                        backgroundColor = new SKPaint()
                        {
                            Color = new SKColor(230, 230, 230)
                        }
                    }))
                };
            }
            else
            {
                // Food
                FlorineSkiaOption SourceOpt = opt as FlorineSkiaOption;
                Food.FoodOption   food_data = opt as Food.FoodOption;
                if (null == food_data && SourceOpt != null)
                {
                    food_data = SourceOpt.SourceOpt as Food.FoodOption;
                }

                if (null != food_data)
                {
                    newOpt.Description = food_data.Parent.Description;
                }
                else
                {
                    newOpt.Description = "Desc Missing";
                }
                List <Tuple <float, SKColor> > MacroNuts = new List <Tuple <float, SKColor> >();
                List <Tuple <float, SKColor> > MicroNuts = new List <Tuple <float, SKColor> >();

                if (null != food_data && food_data.Parent.IsKnown)
                {
                    // Populate nutrient info bars.
                    // List<Tuple<float, SKColor>>

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

                        //45 * ((float)(kvp.Value) / (float)(kvp.Key.DailyTarget));
                        //if (RelativeAmount > 45.0f) { RelativeAmount = 45.0f; }
                        if (kvp.Key.Class == Nutrient.NutrientType.Macro)
                        {
                            RelativeAmount *= 180f / 4f;
                            MacroNuts.Add(new Tuple <float, SKColor>(
                                              RelativeAmount,
                                              AdjNut.RingColor
                                              ));
                        }
                        else
                        {
                            if (RelativeAmount > 1f)
                            {
                                RelativeAmount = 1f;
                            }
                            RelativeAmount *= 180 / 6f;
                            MicroNuts.Add(new Tuple <float, SKColor>(
                                              RelativeAmount,
                                              AdjNut.RingColor
                                              ));
                        }
                    }
                }
                string tokenName = opt.OptionName;
                switch (tokenName)
                {
                case "Grilled Cheese":
                    tokenName = "grilledcheese"; break;

                case "Pancakes":
                    tokenName = "pancakes"; break;

                case "Fruit":
                    tokenName = "fruit"; break;

                case "Eggs":
                    tokenName = "eggs"; break;

                case "Cereal":
                    tokenName = "cereal"; break;

                case "Toaster Pastry":
                    tokenName = "toastedpastry"; break;

                case "Toast":
                case "White Toast":
                case "Wheat Toast":
                case "Multigrain Toast":
                    tokenName = "toast"; break;

                case "Strawberry Yogurt":
                    tokenName = "yogurt"; break;

                case "Eggs, Bacon, and Toast":
                    tokenName = "toasteggsbacon"; break;

                case "Hamburger":
                    tokenName = "hamburger"; break;

                case "Chocolate Ice Cream":
                    tokenName = "icecream"; break;

                case "Instant Noodles":
                    tokenName = "instantnoodles"; break;

                case "Lamb Chops":
                    tokenName = "lambchops"; break;

                case "Meatball Sub":
                    tokenName = "meatballhero"; break;

                case "Peanut Butter & Jelly":
                    tokenName = "pbj"; break;

                case "Pepperoni Pizza Slice":
                    tokenName = "pizza"; break;

                case "Vegetable Soup":
                    tokenName = "soup"; break;

                case "Spaghetti":
                    tokenName = "spaghetti"; break;

                case "Spaghetti w/ Meatballs":
                    tokenName = "spaghettiwmeatball"; break;

                case "Sushi Serving":
                    tokenName = "sushi"; break;

                case "Tacos":
                    tokenName = "tacos"; break;

                case "Donuts":
                    tokenName = "donuts"; break;

                case "Cinnamon Roll":
                    tokenName = "cinnamonroll"; break;

                case "Hamburger Combo":
                    tokenName = "hamburgercombo"; break;

                case "Turkey Sandwich":
                    tokenName = "sandwich"; break;

                case "Sandwich with Chips":
                    tokenName = "sandwichwchips"; break;

                case "Salad":
                    tokenName = "salad"; break;

                case "Fruit Smoothie":
                    tokenName = "fruitsmoothie"; break;
                }

                SKImage ResultImage = ResourceLoader.LoadImage("Images/" + pathType + "/" + tokenName + ".png");
                if (opt is FlorineHardCodedData.HardCodedDataFoundry.NoSelectFoodOption)
                {
                    newOpt.Picture = new SelectableOptionImage()
                    {
                        FoodImage = new LayeredImage()
                        {
                            Layers =
                            {
                                new ImageText(opt.OptionName)
                                {
                                    Overflow = ImageText.WrapType.DiamondWrap, FontSize = 32f
                                },
                                new FlOval()
                                {
                                    mainImage       = null,
                                    backgroundColor = new SKPaint()
                                    {
                                        Color = new SKColor(212, 175, 5)
                                    },
                                    RightRing = MicroNuts,
                                    LeftRing  = MacroNuts,
                                }
                            }
                        }
                    };
                }
                else
                {
                    newOpt.Picture = new SelectableOptionImage()
                    {
                        FoodImage = ((null == ResultImage) ?
                                     (IFlorineSkiaDrawable)(new ImageText(opt.OptionName))
                            : (IFlorineSkiaDrawable)(new FlOval()
                        {
                            mainImage = ResultImage,
                            backgroundColor = new SKPaint()
                            {
                                Color = new SKColor(230, 230, 230)
                            },
                            RightRing = MicroNuts,
                            LeftRing = MacroNuts,
                        }))
                    };
                }
            }

            return(newOpt);
        }
Example #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;
        }
Example #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;
        }
        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);
        }