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 }
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 _); }
public void DrawDice(SKCanvas dc) { if (Visible == false) { return; //just in case. } if (CanStartDrawing() == false) { return; } dc.Clear(); SKRect rect_Card; rect_Card = SKRect.Create(0, 0, ActualWidthHeight, ActualWidthHeight); //i think dc.DrawRoundRect(rect_Card, RoundedRadius, RoundedRadius, _fillPaint); if (IsSelected == true) { dc.DrawRoundRect(rect_Card, RoundedRadius, RoundedRadius, _selectPaint); } dc.DrawRoundRect(rect_Card, RoundedRadius, RoundedRadius, _borderPaint); var fontSize = rect_Card.Height * .5f; SKPaint textPaint = MiscHelpers.GetTextPaint(SKColors.White, fontSize); dc.DrawBorderText(Value, EnumLayoutOptions.Center, EnumLayoutOptions.Center, textPaint, _textBorder !, rect_Card); }
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 _); }
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 _); }
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 _); }
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 _); }
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 _); }
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 DrawValue(SKCanvas thisCanvas, SKRect thisRect) { var fontSize = thisRect.Height * 1.1f; var textPaint = MiscHelpers.GetTextPaint(SKColors.Aqua, fontSize); var pen = MiscHelpers.GetStrokePaint(SKColors.Black, 1); thisCanvas.DrawBorderText(Value.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, pen, thisRect); // value is already given }
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 }
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 _); }
private void DrawDistanceCard(SKCanvas canvas, string str_Text, SKRect rect_Card) { SKPath gp_Card; SKPaint pn_Card; SKPaint textBorder; SKColor clr_Text = SKColors.Black; SKColor clr_Border = SKColors.Red; SKPaint textPaint; switch (str_Text) { case "25": { clr_Text = SKColors.Red; clr_Border = SKColors.Green; break; } case "50": { clr_Text = SKColors.Red; clr_Border = SKColors.Blue; break; } case "75": { clr_Text = SKColors.Green; clr_Border = SKColors.Red; break; } case "100": { clr_Text = SKColors.Green; clr_Border = SKColors.Blue; break; } case "200": { clr_Text = SKColors.Blue; clr_Border = SKColors.Green; break; } } pn_Card = MiscHelpers.GetStrokePaint(clr_Border, rect_Card.Width / 20); gp_Card = new SKPath(); gp_Card.AddArc(SKRect.Create(System.Convert.ToInt32((rect_Card.Left + (rect_Card.Width / 10))), System.Convert.ToInt32((rect_Card.Top + (rect_Card.Height / 10))), System.Convert.ToInt32(((rect_Card.Width * 4) / 5)), System.Convert.ToInt32(((rect_Card.Height * 3) / 7))), 180, 180); gp_Card.AddLine(System.Convert.ToInt32((rect_Card.Left + ((rect_Card.Width * 9) / 10))), System.Convert.ToInt32((rect_Card.Top + ((rect_Card.Height * 9) / 10))), System.Convert.ToInt32((rect_Card.Left + (rect_Card.Width / 10))), System.Convert.ToInt32((rect_Card.Top + ((rect_Card.Height * 9) / 10)))); gp_Card.Close(); canvas.DrawPath(gp_Card, pn_Card); textPaint = MiscHelpers.GetTextPaint(clr_Text, rect_Card.Height / 3); textBorder = MiscHelpers.GetStrokePaint(SKColors.Black, 1); // for speed limit, 1 is fine textPaint.FakeBoldText = true; canvas.DrawBorderText(str_Text, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, textBorder, rect_Card); }
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 fontSize = tempRect.Height * 1.2f; var textPaint = MiscHelpers.GetTextPaint(SKColors.Aqua, fontSize); canvas.DrawBorderText("X", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, _blackBorder !, tempRect); }
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 DrawBacks(SKCanvas canvas, SKRect rect_Card) { if (BackText == "") { throw new BasicBlankException("Must have the back text"); } var thisList = BackText.Split(" ").ToList(); if (thisList.Count > 2) { throw new Exception("Only 2 lines are supported currently"); } var thisFill = GetFillColor(); var thisPaint = GetSolidPaint(thisFill); DrawDefaultRectangles(canvas, rect_Card, thisPaint); SKPaint textPaint; CustomBasicList <SKRect> rectList = new CustomBasicList <SKRect>(); if (thisList.Count == 1) { rectList.Add(rect_Card); } else { SKRect firstRect; firstRect = SKRect.Create(8, 8, rect_Card.Width - 6, rect_Card.Height / 2.1f); var secondRect = SKRect.Create(8, rect_Card.Height / 2, rect_Card.Width - 6, rect_Card.Height / 2.1f); rectList.Add(firstRect); rectList.Add(secondRect); } if (rectList.Count != thisList.Count) { throw new BasicBlankException("Numbers Don't Match For Drawing Backs"); } int x = 0; foreach (var thisRect in rectList) { float fontSize; var ThisText = thisList[x]; if (ThisText.Length == 5) { fontSize = rect_Card.Height / 4.2f; } else { fontSize = rect_Card.Height / 3.6f; } textPaint = MiscHelpers.GetTextPaint(BackFontColor, fontSize); canvas.DrawBorderText(ThisText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, _textBorder !, thisRect); x++; } }
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 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 !); }
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 _); }
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 _); }
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 _); }
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 _); }
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 _); }
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; } }
private void DrawFill(SKCanvas canvas) // okay now. { SKRect firstText; firstText = MainGraphics !.GetActualRectangle(0, 30, 107, 25); var firstPaint = MiscHelpers.GetTextPaint(SKColors.Red, MainGraphics.GetFontSize(40)); var secondPaint = MiscHelpers.GetTextPaint(SKColors.Aqua, MainGraphics.GetFontSize(35)); var TempRect = MainGraphics.GetActualRectangle(15, 65, 77, 35); canvas.DrawRect(TempRect, _redFill); canvas.DrawBorderText("Fill", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, firstPaint, _borderTextPaint !, firstText); canvas.DrawBorderText("1000", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, secondPaint, _borderTextPaint !, TempRect); }
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); }
private void DrawBonus(SKCanvas canvas) // okay now { var firstRect = MainGraphics !.GetActualRectangle(7, 7, 95, 25); var secondRect = MainGraphics.GetActualRectangle(7, 100, 95, 25); canvas.DrawRect(firstRect, _redFill); canvas.DrawRect(secondRect, _redFill); var firstText = MainGraphics.GetActualRectangle(0, 37, 107, 35); var secondTExt = MainGraphics.GetActualRectangle(0, 72, 107, 35); var thisPaint = MiscHelpers.GetTextPaint(SKColors.Maroon, MainGraphics.GetFontSize(35)); canvas.DrawBorderText("Bonus", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, thisPaint, _borderTextPaint !, firstText); canvas.DrawBorderText(Value.ToString(), TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, thisPaint, _borderTextPaint !, secondTExt); }
public void DrawBacks(SKCanvas canvas, SKRect rect_Card) { canvas.DrawRect(rect_Card, _backPaint); CustomBasicList <SKRect> thisList = new CustomBasicList <SKRect>(); float fontSize; fontSize = rect_Card.Height / 3.2f; var textPaint = MiscHelpers.GetTextPaint(SKColors.Yellow, fontSize); var thisRect = SKRect.Create(2, 2, rect_Card.Width, rect_Card.Height / 3); thisList.Add(thisRect); thisRect = SKRect.Create(2, rect_Card.Height / 3, rect_Card.Width, rect_Card.Height / 3); thisList.Add(thisRect); thisRect = SKRect.Create(2, (rect_Card.Height / 3) * 2, rect_Card.Width, rect_Card.Height / 3); thisList.Add(thisRect); int x = 0; string thisText; foreach (var ThisRect in thisList) { x += 1; switch (x) { case 1: { thisText = "Hit"; break; } case 2: { thisText = "The"; break; } case 3: { thisText = "Deck"; break; } default: { throw new BasicBlankException("Only 3 lines"); } } canvas.DrawBorderText(thisText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, _textBorder !, ThisRect); } }
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); }