コード例 #1
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 _);
        }
コード例 #2
0
        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 !);
        }
コード例 #3
0
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            if (IsJoker == true)
            {
                var thisPen  = MiscHelpers.GetStrokePaint(_tempColor, 2);
                var tempRect = MainGraphics !.GetActualRectangle(SKRect.Create(16, 6, 28, 28));
                canvas.DrawSmiley(tempRect, null !, thisPen, _blackPaint !);
                return;
            }
            var fontSize = rect_Card.Height * 0.9f; // can be adjusted obviously
            var paint    = MiscHelpers.GetTextPaint(_tempColor, fontSize);

            canvas.DrawBorderText(Number.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, paint, _blackBorder !, rect_Card);
        }