private void DrawHouseText(SKCanvas thisCanvas)
        {
            var    firstRect  = MainGraphics !.GetActualRectangle(2, 2, 51, 18);
            var    secondRect = MainGraphics.GetActualRectangle(2, 15, 51, 18);
            string firstText  = "";

            if (CardValue == 8)
            {
                firstText = "1st";
            }
            else if (CardValue == 9)
            {
                firstText = "2nd";
            }
            else if (CardValue == 10)
            {
                firstText = "3rd";
            }
            else if (CardValue == 11)
            {
                firstText = "4th";
            }
            var fontSize  = MainGraphics.GetFontSize(13);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            thisCanvas.DrawCustomText(firstText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            thisCanvas.DrawCustomText("House", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
        }
        private void DrawRailRoadText(SKCanvas thisCanvas)
        {
            var firstRect  = MainGraphics !.GetActualRectangle(0, 2, 55, 15);
            var secondRect = MainGraphics.GetActualRectangle(0, 15, 55, 15);
            var fontSize   = MainGraphics.GetFontSize(11);
            var textPaint  = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            string firstText = "";

            if (CardValue == 13)
            {
                firstText = "Reading";
            }
            else if (CardValue == 14)
            {
                firstText = "Penny";
            }
            else if (CardValue == 15)
            {
                firstText = "B & O";
            }
            else if (CardValue == 16)
            {
                firstText = "Shortline";
            }
            thisCanvas.DrawCustomText(firstText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            thisCanvas.DrawCustomText("Railroad", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
        }
Exemplo n.º 3
0
        private void DrawHouseCard(SKCanvas canvas)
        {
            var      pictRect   = MainGraphics !.GetActualRectangle(20, 8, 40, 40);
            var      firstRect  = MainGraphics.GetActualRectangle(8, 65, 64, 27);
            var      secondRect = MainGraphics.GetActualRectangle(8, 48, 64, 17);
            SKBitmap thisBit;

            thisBit = ImageExtensions.GetSkBitmap(_thisA !, House.ToString() + ".png");
            canvas.DrawBitmap(thisBit, pictRect, MainGraphics.BitPaint);
            var thisText   = House.ToString().GetWords();
            var firstText  = MiscHelpers.GetTextPaint(SKColors.White, firstRect.Height * 0.4f);
            var secondText = MiscHelpers.GetTextPaint(SKColors.Black, secondRect.Height * 0.8f);

            secondText.FakeBoldText = true;
            canvas.DrawRect(firstRect, _darkOrangePaint);
            if ((int)House == (int)EnumHouseType.DutchColonial)
            {
                firstRect = MainGraphics.GetActualRectangle(8, 63, 64, 17);
                canvas.DrawCustomText("Dutch", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, firstText, firstRect, out _);
                firstRect = MainGraphics.GetActualRectangle(8, 75, 64, 17);
                canvas.DrawCustomText("Colonial", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, firstText, firstRect, out _);
            }
            else
            {
                canvas.DrawCustomText(thisText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, firstText, firstRect, out _);
            }
            canvas.DrawCustomText(HouseValue.ToCurrency(0), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, secondText, secondRect, out _);
        }
Exemplo n.º 4
0
        private void DrawSalaryCard(SKCanvas canvas)
        {
            var     firstRect  = MainGraphics !.GetActualRectangle(3, 3, 70, 20);
            var     secondRect = MainGraphics.GetActualRectangle(3, 24, 70, 20);
            var     thirdRect  = MainGraphics.GetActualRectangle(3, 55, 70, 20);
            var     fourthRect = MainGraphics.GetActualRectangle(3, 76, 70, 20);
            var     fontSize   = firstRect.Height * 0.75f; // trial and error
            var     blackText  = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);
            SKColor otherColor;

            blackText.FakeBoldText = true;
            switch (CollectAmount)
            {
            case var @case when @case == 100000:
            {
                otherColor = SKColors.DarkOrange;
                break;
            }

            case var case1 when case1 == 90000:
            case var case2 when case2 == 70000:
            case var case3 when case3 == 60000:
            {
                otherColor = SKColors.Green;
                break;
            }

            case var case4 when case4 == 80000:
            case var case5 when case5 == 30000:
            case var case6 when case6 == 40000:
            {
                otherColor = SKColors.Red;
                break;
            }

            case var case7 when case7 == 50000:
            case var case8 when case8 == 20000:
            {
                otherColor = SKColors.DarkBlue;
                break;
            }

            default:
            {
                throw new BasicBlankException("The collect amount is wrong. You entered " + CollectAmount);
            }
            }
            var otherText = MiscHelpers.GetTextPaint(otherColor, fontSize);

            otherText.FakeBoldText = true;
            canvas.DrawCustomText("Collect", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, blackText, firstRect, out _);
            canvas.DrawCustomText(CollectAmount.ToCurrency(0), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, otherText, secondRect, out _);
            canvas.DrawCustomText("Taxes Due", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, blackText, thirdRect, out _);
            canvas.DrawCustomText(TaxAmount.ToCurrency(0), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, blackText, fourthRect, out _);
        }
        private void DrawMRMonopolyText(SKCanvas thisCanvas)
        {
            var fontSize   = MainGraphics !.GetFontSize(10);
            var firstRect  = MainGraphics.GetActualRectangle(0, 5, 55, 15);
            var secondRect = MainGraphics.GetActualRectangle(0, 15, 55, 15);
            var textPaint  = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            thisCanvas.DrawCustomText("Mr.", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            thisCanvas.DrawCustomText("Monopoly", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
        }
Exemplo n.º 6
0
        public void DrawBacks(SKCanvas canvas, SKRect rect_Card)
        {
            var firstRect  = MainGraphics !.GetActualRectangle(0, 1, 54, 23);
            var fontSize   = firstRect.Height * 0.65f; // can adjust as needed
            var textPaint  = MiscHelpers.GetTextPaint(SKColors.Red, fontSize);
            var secondRect = MainGraphics.GetActualRectangle(0, 25, 54, 23);
            var thirdRect  = MainGraphics.GetActualRectangle(0, 49, 54, 23);

            canvas.DrawCustomText("8", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            canvas.DrawCustomText("Round", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
            canvas.DrawCustomText("Rummy", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, thirdRect, out _);
        }
Exemplo n.º 7
0
        private void DrawReverse(SKCanvas canvas) // hopefully this simple.
        {
            var firstRect  = MainGraphics !.GetActualRectangle(0, 1, 54, 23);
            var fontSize   = firstRect.Height * 0.55f; // can adjust as needed
            var textPaint  = MiscHelpers.GetTextPaint(SKColors.Green, fontSize);
            var secondRect = MainGraphics.GetActualRectangle(0, 25, 54, 23);
            var thirdRect  = MainGraphics.GetActualRectangle(0, 49, 54, 23);

            canvas.DrawCustomText("Reverse", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            canvas.DrawCustomText("And New", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
            canvas.DrawCustomText("Hand", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, thirdRect, out _);
        }
Exemplo n.º 8
0
        private void DrawSpace(SKCanvas canvas, TempSpace thisItem)
        {
            var thisPaint = MiscHelpers.GetSolidPaint(thisItem.Fill);
            var ThisRect  = thisItem.Bounds;

            canvas.DrawRect(ThisRect, _borderPaint);
            canvas.DrawRect(ThisRect, thisPaint);
            SKPaint textPaint;
            int     number;

            number = _spaceList.GetKey(thisItem);
            if (number == 100)
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Yellow, (thisItem.Bounds.Height * 4) / 9, "Comic Sans MS");
            }
            else if ((number % 10) == 0)
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Red, (thisItem.Bounds.Height * 21) / 36, "Comic Sans MS");
            }
            else
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Red, (thisItem.Bounds.Height * 5) / 9, "Comic Sans MS");
            }
            textPaint.FakeBoldText = true;
            canvas.DrawCustomText(number.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, thisItem.Bounds, out _);
        }
Exemplo n.º 9
0
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            if (_gameContainer == null)
            {
                _gameContainer = Resolve <SorryGameContainer>();
            }
            string realText;
            string value = _gameContainer.SaveRoot !.CurrentCard !.Value.ToString();

            if (value == "13")
            {
                realText = "S";
            }
            else
            {
                realText = value;
            }
            float fontSize;

            if (int.Parse(value) < 10 || realText == "S")
            {
                fontSize = rect_Card.Width * 1.8f;
            }
            else
            {
                fontSize = rect_Card.Width * .9f;
            }
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            if (value == "0")
            {
                return;
            }
            canvas.DrawCustomText(realText, TextExtensions.EnumLayoutOptions.Start, TextExtensions.EnumLayoutOptions.Center, textPaint, rect_Card, out _);
        }
Exemplo n.º 10
0
        public void DrawBacks(SKCanvas canvas, SKRect rect_Card)
        {
            var tempRect = SKRect.Create(rect_Card.Location.X + 3, rect_Card.Location.Y + 3, rect_Card.Width - 6, rect_Card.Height - 6);

            canvas.DrawRect(tempRect, _redPaint);

            var firstRect  = SKRect.Create(tempRect.Location.X, tempRect.Location.Y, tempRect.Width, tempRect.Height / 3);
            var secondRect = SKRect.Create(tempRect.Location.X, firstRect.Bottom, tempRect.Width, firstRect.Height);
            var thirdRect  = SKRect.Create(tempRect.Location.X, secondRect.Bottom, tempRect.Width, secondRect.Height);
            var fontSize   = firstRect.Height * 0.6f; // can experiment
            var textPaint  = MiscHelpers.GetTextPaint(SKColors.White, fontSize);

            canvas.DrawCustomText("Yahtzee", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            canvas.DrawCustomText("Hands", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
            canvas.DrawCustomText("Down", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, thirdRect, out _);
        }
        public void DrawBacks(SKCanvas canvas, SKRect rect_Card)
        {
            float   fontSize  = rect_Card.Height * .9f;
            SKPaint textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            canvas.DrawCustomText("Racko", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, rect_Card, out _);
        }
        public override void DrawImage(SKCanvas dc)
        {
            var thisRect = GetMainRect();

            if (CanDrawText() == false)
            {
                return;
            }
            if (NeedsToClear == true)
            {
                dc.Clear();// has to clear everytime.
            }
            SelectProcesses();
            DrawSelector(dc);
            float fontSize;

            if (SmallerFontSize == false)
            {
                fontSize = thisRect.Height * 0.8f; // i think
            }
            else
            {
                fontSize = 20;
            }
            var TextPaint = MiscHelpers.GetTextPaint(TextColor, fontSize);

            dc.DrawCustomText(DisplayText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, TextPaint, thisRect, out _); // i think
        }
        public void DrawBacks(SKCanvas canvas, SKRect rect_Card)
        {
            var fontSize = MainGraphics !.GetFontSize(13);

            canvas.Save();
            canvas.RotateDrawing(RotateExtensions.EnumRotateCategory.FlipAndRotate270, rect_Card);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Navy, fontSize);

            textPaint.FakeBoldText = true;
            var tempRect = MainGraphics.GetActualRectangle(-18, 15, 72, 55);

            canvas.DrawCustomText("Monopoly", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, textPaint, tempRect, out _);
            tempRect = MainGraphics.GetActualRectangle(-18, 30, 72, 55);
            canvas.DrawCustomText("Card Game", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, textPaint, tempRect, out _);
            canvas.Restore();
        }
        private void DrawHotel(SKCanvas thisCanvas)
        {
            var firstRect = MainGraphics !.GetActualRectangle(2, 2, 51, 28);
            var fontSize  = MainGraphics.GetFontSize(14);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            thisCanvas.DrawCustomText("Hotel", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            var bounds = MainGraphics.GetActualRectangle(15, 30, 25, 35);

            thisCanvas.DrawRect(bounds, _redPaint);
            int int_Row;
            int int_Col;

            for (int_Row = 0; int_Row <= 2; int_Row++)
            {
                for (int_Col = 0; int_Col <= 1; int_Col++)
                {
                    thisCanvas.DrawRect(SKRect.Create(bounds.Location.X + (bounds.Width / 20) + ((bounds.Width / 5) * int_Col), bounds.Location.Y + (bounds.Height / 10) + ((bounds.Height / 5) * int_Row), bounds.Width / 6, bounds.Height / 6), _whitePaint);
                }
                for (int_Col = 1; int_Col <= 2; int_Col++)
                {
                    thisCanvas.DrawRect(SKRect.Create((bounds.Location.X + ((bounds.Width * 19) / 20)) - ((bounds.Width / 5) * int_Col), bounds.Location.Y + (bounds.Height / 10) + ((bounds.Height / 5) * int_Row), bounds.Width / 6, bounds.Height / 6), _whitePaint);
                }
            }
            thisCanvas.DrawRect(SKRect.Create((bounds.Location.X + (bounds.Width / 2)) - (bounds.Width / 10), bounds.Location.Y + ((bounds.Height * 4) / 5), bounds.Width / 5, bounds.Height / 5), _whitePaint);
        }
        private void DrawGo(SKCanvas thisCanvas)
        {
            var firstRect = MainGraphics !.GetActualRectangle(0, 0, 55, 40);
            var fontSize  = MainGraphics.GetFontSize(30);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Red, fontSize);

            textPaint.FakeBoldText = true;
            thisCanvas.DrawBorderText("Go", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, _blackBorder1 !, firstRect);
            var secondRect = MainGraphics.GetActualRectangle(0, 35, 55, 20);

            fontSize  = MainGraphics.GetFontSize(14); // decided to make slightly smaller
            textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);
            textPaint.FakeBoldText = true;
            var thirdRect = MainGraphics.GetActualRectangle(0, 53, 55, 20);

            thisCanvas.DrawCustomText("Collect", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
            thisCanvas.DrawCustomText("$200", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, thirdRect, out _);
        }
Exemplo n.º 16
0
        private void DrawStockCard(SKCanvas canvas)
        {
            var firstRect  = MainGraphics !.GetActualRectangle(3, 10, 70, 20);
            var secondRect = MainGraphics.GetActualRectangle(3, 31, 70, 20);
            var thirdRect  = MainGraphics.GetActualRectangle(3, 51, 70, 20);
            var fourthRect = MainGraphics.GetActualRectangle(3, 76, 70, 20);
            var fontSize   = firstRect.Height * 0.75f; // trial and error
            var otherSize  = firstRect.Height * 1.2f;
            var otherText  = MiscHelpers.GetTextPaint(SKColors.Purple, otherSize);
            var blackText  = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            blackText.FakeBoldText = true;
            otherText.FakeBoldText = true;
            canvas.DrawCustomText(StockValue.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, otherText, firstRect, out _);
            canvas.DrawCustomText("Stock", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, blackText, secondRect, out _);
            canvas.DrawCustomText("Certificate", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, blackText, thirdRect, out _);
            canvas.DrawCustomText("$50,000", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, blackText, fourthRect, out _); // its okay to do manually
        }
Exemplo n.º 17
0
        private void DrawRevenge(SKCanvas canvas)
        {
            SKRect rect_Piece;
            SKRect tempRect;

            tempRect = MainGraphics !.GetActualRectangle(4, 5, 109, 27);
            var ThisPaint = MiscHelpers.GetTextPaint(SKColors.Aqua, MainGraphics.GetFontSize(19));

            ThisPaint.FakeBoldText = true;
            canvas.DrawCustomText("Vengeance", TextExtensions.EnumLayoutOptions.Start, TextExtensions.EnumLayoutOptions.Start, ThisPaint, tempRect, out _);
            tempRect = MainGraphics.GetActualRectangle(-1, 27, 109, 27);
            canvas.DrawCustomText("2500", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, ThisPaint, tempRect, out _);
            rect_Piece = MainGraphics.GetActualRectangle(6, 59, 95, 80);
            canvas.DrawRect(rect_Piece, _redFill);
            var ThisImage = ImageExtensions.GetSkBitmap(_thisAssembly !, "revenge.png");

            canvas.DrawBitmap(ThisImage, rect_Piece, MainGraphics.BitPaint);
        }
        private void DrawUtilityText(SKCanvas thisCanvas)
        {
            var thisRect  = MainGraphics !.GetActualRectangle(0, 0, 55, 26);
            var fontSize  = MainGraphics.GetFontSize(15);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            thisCanvas.DrawCustomText("Utility", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, thisRect, out _);
        }
Exemplo n.º 19
0
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            var thisText  = Letter.ToString().ToUpper();
            var thisColor = thisText.GetColorOfLetter();
            var fontSize  = MainGraphics !.GetFontSize(21);
            var thisPaint = MiscHelpers.GetTextPaint(thisColor, fontSize);

            canvas.DrawCustomText(thisText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, thisPaint, rect_Card, out _); // hopefully this simple
        }
Exemplo n.º 20
0
        private void DrawWild(SKCanvas canvas)
        {
            var smileRect = MainGraphics !.GetActualRectangle(8, 5, 40, 40);
            var textRect  = MainGraphics.GetActualRectangle(0, 40, 55, 30);
            var fontSize  = textRect.Height * 0.7f;                             // can always adjust
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize); // it can be different shape too though.

            canvas.DrawSmiley(smileRect, null !, _thickBorders !, _blackPaint !);
            canvas.DrawCustomText("WILD", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, textRect, out _);
        }
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            SKRect topRect;

            topRect = MainGraphics !.GetActualRectangle(13, 13, 50, 50);
            canvas.DrawOval(topRect, _greenPaint);
            if (IsMulligan == false)
            {
                var firstFonts     = topRect.Height * 0.8f;
                var firstTextPaint = MiscHelpers.GetTextPaint(SKColors.White, firstFonts);
                canvas.DrawBorderText(Points.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, firstTextPaint, _blackBorder !, topRect);
            }
            SKRect fullBottom;

            fullBottom = MainGraphics.GetActualRectangle(4, 67, 68, 35);
            var     firstBottom  = MainGraphics.GetActualRectangle(4, 67, 68, 17);
            var     secondBottom = MainGraphics.GetActualRectangle(4, 84, 68, 17);
            var     thisList     = GetTextList();
            var     fontSize     = fullBottom.Height * 0.41f;
            SKPaint thisPaint;

            if (IsMulligan == true)
            {
                thisPaint = MiscHelpers.GetTextPaint(SKColors.Red, fontSize);
            }
            else
            {
                thisPaint = MiscHelpers.GetTextPaint(SKColors.Green, fontSize);
            }
            if (thisList.Count == 1)
            {
                canvas.DrawCustomText(thisList.Single(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, thisPaint, fullBottom, out _);
            }
            else if (thisList.Count == 2)
            {
                canvas.DrawCustomText(thisList.First(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, thisPaint, firstBottom, out _);
                canvas.DrawCustomText(thisList.Last(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, thisPaint, secondBottom, out _);
            }
            else
            {
                throw new BasicBlankException("Rethink");
            }
        }
        private void DrawJoker(SKCanvas canvas)
        {
            var firstRect = MainGraphics !.GetActualRectangle(2, 2, 55, 20);
            var fontSize  = firstRect.Height * 0.8f; // can be adjusted as needed
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            canvas.DrawCustomText("Joker", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            var secondRect = MainGraphics.GetActualRectangle(8, 25, 40, 40); // i think this makes more sense

            canvas.DrawSmiley(secondRect, null !, _thickBorder !, _blackPaint !);
        }
        public override void DrawImage(SKCanvas dc)
        {
            var     thisRect = GetRectangle();
            SKPaint thisPaint;

            thisPaint = MiscHelpers.GetSolidPaint(FillColor);
            dc.DrawRect(thisRect, thisPaint);
            thisPaint = MiscHelpers.GetStrokePaint(BorderColor, BorderWidth);
            dc.DrawRect(thisRect, thisPaint);
            thisPaint = MiscHelpers.GetTextPaint(TextColor, FontSize);
            dc.DrawCustomText(Text, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, thisPaint, thisRect, out _);
        }
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            var     maxSize   = MainGraphics !.GetFontSize(40);
            double  percs     = Value / (double)_maxs;
            var     maxLeft   = rect_Card.Width - maxSize;
            var     lefts     = maxLeft * percs;
            var     tempRect  = SKRect.Create((float)lefts, 0, rect_Card.Width, rect_Card.Height);
            float   fontSize  = rect_Card.Height * .9f;
            SKPaint TextPaint = MiscHelpers.GetTextPaint(SKColors.Red, fontSize);

            canvas.DrawCustomText(Value.ToString(), TextExtensions.EnumLayoutOptions.Start, TextExtensions.EnumLayoutOptions.Center, TextPaint, tempRect, out _);
        }
        private void DrawTopRow(SKCanvas thisCanvas)
        {
            var firstRect  = GetActualRectangle(3, 3, 35, 40);
            var secondRect = GetActualRectangle(38, 3, 35, 40);
            var thirdRect  = GetActualRectangle(73, 3, 15, 40);
            var fourthRect = GetActualRectangle(88, 3, 15, 40);
            var fifthRect  = GetActualRectangle(103, 3, 15, 40);

            DrawBorders(thisCanvas, firstRect);
            DrawBorders(thisCanvas, secondRect);
            DrawBorders(thisCanvas, thirdRect);
            DrawBorders(thisCanvas, fourthRect);
            DrawBorders(thisCanvas, fifthRect);
            var fontSize  = firstRect.Height * 0.28f;
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            thisCanvas.DrawCustomText("Value", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            thisCanvas.DrawCustomText("Cards", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
            var cubeSize  = GetActualSize(12, 12);
            var pointList = ImageHelpers.GetPoints(EnumShapes.Cubes, 1, thirdRect.Location, true, cubeSize.Height);

            foreach (var thisPoint in pointList)
            {
                var tempRect = SKRect.Create(thisPoint, cubeSize);
                ImageHelpers.DrawCube(thisCanvas, tempRect);
            }
            pointList = ImageHelpers.GetPoints(EnumShapes.Cubes, 2, fourthRect.Location, true, cubeSize.Height);
            foreach (var thisPoint in pointList)
            {
                var tempRect = SKRect.Create(thisPoint, cubeSize);
                ImageHelpers.DrawCube(thisCanvas, tempRect);
            }
            pointList = ImageHelpers.GetPoints(EnumShapes.Cubes, 3, fifthRect.Location, true, cubeSize.Height);
            foreach (var thisPoint in pointList)
            {
                var tempRect = SKRect.Create(thisPoint, cubeSize);
                ImageHelpers.DrawCube(thisCanvas, tempRect);
            }
        }
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            if (Points > 7 || Points < 1)
            {
                throw new Exception("Points only go from 1 to 7");
            }
            if (Points == 4 || Points == 6)
            {
                throw new Exception("There should be no 4 or 6 points");
            }
            var tempSize = MainGraphics !.GetFontSize(3);
            var tempRect = SKRect.Create(rect_Card.Location.X + tempSize, rect_Card.Location.Y + tempSize, rect_Card.Width - (tempSize * 2), rect_Card.Height - (tempSize * 2));

            canvas.DrawRect(tempRect, _darkSlateBluePaint);
            var firstRect = MainGraphics.GetActualRectangle(5, 12, 45, 45);

            canvas.DrawRect(firstRect, _whitePaint);
            canvas.DrawRect(firstRect, _blackBorder);
            firstRect = MainGraphics.GetActualRectangle(5, 12, 40, 30);
            var fontSize  = MainGraphics.GetFontSize(30);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            canvas.DrawCustomText(Points.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _); // well see
            var secondRect = MainGraphics.GetActualRectangle(3, 37, 50, 20);

            fontSize  = MainGraphics.GetFontSize(14);
            textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);
            textPaint.FakeBoldText = true;
            string thisText;

            if (Points == 1)
            {
                thisText = "Point";
            }
            else
            {
                thisText = "Points";
            }
            canvas.DrawCustomText(thisText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _);
        }
        protected override void DrawBoard(SKCanvas canvas)
        {
            var tempRect = GetBounds();

            canvas.DrawRect(tempRect, _whitePaint);
            DrawTopRow(canvas);
            int x;
            int y;
            int tops;

            tops = 43;
            int  lefts;
            var  diff1X    = 35;
            var  diff2X    = 15;
            var  diffY     = 20;
            bool doPaint   = true;
            var  fontSize  = GetFontSize(15); // can adjust as needed
            var  textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            for (x = 4; x <= 12; x++)
            {
                lefts = 3;
                for (y = 1; y <= 5; y++)
                {
                    int currentX;
                    if (y == 1 || y == 2)
                    {
                        currentX = diff1X;
                    }
                    else
                    {
                        currentX = diff2X;
                    }
                    var ThisRect = GetActualRectangle(lefts, tops, currentX, diffY);
                    if (doPaint == true)
                    {
                        canvas.DrawRect(ThisRect, _lightGrayPaint);
                    }
                    DrawBorders(canvas, ThisRect);
                    var displayValue = GetTextValue(y, x);
                    if (displayValue > 0)
                    {
                        canvas.DrawCustomText(displayValue.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, ThisRect, out _);
                    }

                    lefts += currentX;
                }
                tops   += diffY;
                doPaint = !doPaint;
            }
        }
Exemplo n.º 28
0
        private void DrawWild(SKCanvas thisCanvas, SKRect rect_Card)
        {
            var tempRect = GetStartingRect(rect_Card);

            thisCanvas.DrawRect(tempRect, GetColorUsed()); // i think
            var otherRect = GetCenterDiceRect();
            var tempSize  = MainGraphics !.GetFontSize(3);

            thisCanvas.DrawRoundRect(otherRect, tempSize, tempSize, _whitePaint);
            thisCanvas.DrawRoundRect(otherRect, tempSize, tempSize, _thickBorder);
            var fontSize  = otherRect.Height * 0.38f; // can adjust as needed
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            thisCanvas.DrawCustomText("WILD", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, otherRect, out _);
        }
        private void DrawChance(SKCanvas thisCanvas)
        {
            var firstRect = MainGraphics !.GetActualRectangle(2, 0, 51, 26);
            var fontSize  = MainGraphics.GetFontSize(12);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize);

            textPaint.FakeBoldText = true;
            thisCanvas.DrawCustomText("Chance", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _);
            var secondRect = MainGraphics.GetActualRectangle(0, 10, 60, 70);

            fontSize  = MainGraphics.GetFontSize(45);
            textPaint = MiscHelpers.GetTextPaint(SKColors.Red, fontSize);
            textPaint.FakeBoldText = true;
            thisCanvas.DrawBorderText("?", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, _blackBorder1 !, secondRect);
        }
        public override void DrawImage(SKCanvas dc)
        {
            if (NeedsToClear == true)
            {
                dc.Clear();// needs to always clear.
            }
            if (Number == 0)
            {
                return;
            }
            SKColor thisColor;
            var     tempColor = MainColor.ToSKColor();

            thisColor = new SKColor(tempColor.Red, tempColor.Green, tempColor.Blue, 150); // i think
            var thisPaint = MiscHelpers.GetSolidPaint(thisColor);
            var thisRect  = GetMainRect();

            dc.DrawOval(thisRect, thisPaint);
            dc.DrawOval(thisRect, _borderPaint);
            var thisText = MiscHelpers.GetTextPaint(SKColors.White, thisRect.Height * 0.7f);

            dc.DrawCustomText(Number.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, thisText, thisRect, out _);
        }