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 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 _); }
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 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 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); }
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); }
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); }
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 _); }
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 DrawMustBust(SKCanvas canvas, SKRect thisRect) { SKRect firstRect; SKRect lastRect; firstRect = MainGraphics !.GetActualRectangle(7, 10, 93, 25); lastRect = MainGraphics.GetActualRectangle(7, 100, 93, 25); canvas.DrawRect(firstRect, _maroonFill); canvas.DrawRect(firstRect, _aquaPen); canvas.DrawRect(lastRect, _maroonFill); canvas.DrawRect(lastRect, _aquaPen); var textPaint = MiscHelpers.GetTextPaint(SKColors.Aqua, MainGraphics.GetFontSize(30)); var textRect = MainGraphics.GetActualRectangle(0, 43, 107, 37); canvas.DrawBorderText("Must", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, textPaint, _borderTextPaint !, textRect); textRect = MainGraphics.GetActualRectangle(SKRect.Create(thisRect.Left, 72, 107, 37)); canvas.DrawBorderText("Bust!", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, textPaint, _borderTextPaint !, textRect); }
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 _); }
private void DrawNoDice(SKCanvas canvas) { var textRect = MainGraphics !.GetActualRectangle(0, 10, 107, 44); var thisPaint = MiscHelpers.GetTextPaint(SKColors.Aqua, MainGraphics.GetFontSize(27)); canvas.DrawBorderText("No Dice", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, thisPaint, _borderTextPaint !, textRect); var lastRect = MainGraphics.GetActualRectangle(23, 59, 60, 60); var thisPen = MiscHelpers.GetStrokePaint(SKColors.Red, 7); // i think 7 no matter what (?) canvas.DrawOval(lastRect, thisPen); StandardDiceGraphicsCP thisDice = new StandardDiceGraphicsCP(); thisDice.Location = new SKPoint(lastRect.Left + (lastRect.Size.Width / 4), lastRect.Top + (lastRect.Size.Height / 4)); thisDice.NeedsToClear = false; // its this instead. var thisSize = MainGraphics.GetActualSize(new SKSize(34, 34)); thisDice.ActualWidthHeight = thisSize.Height; thisDice.UseSmallerBorders(); thisDice.Value = 6; thisDice.DrawDice(canvas); canvas.DrawLine(lastRect.Left + 10, lastRect.Top + 10, lastRect.Right - 10, lastRect.Bottom - 10, thisPen); }
private void DrawDoubleTrouble(SKCanvas canvas) { SKRect firstRect; SKRect lastRect; SKRect firstText; SKRect middleText; SKRect lastText; firstRect = MainGraphics !.GetActualRectangle(5, 5, 97, 20); lastRect = MainGraphics.GetActualRectangle(5, 109, 97, 20); var firstPaint = MiscHelpers.GetTextPaint(SKColors.LightPink, MainGraphics.GetFontSize(25)); var middlePaint = MiscHelpers.GetTextPaint(SKColors.Maroon, MainGraphics.GetFontSize(25)); firstText = MainGraphics.GetActualRectangle(0, 26, 107, 30); middleText = MainGraphics.GetActualRectangle(0, 56, 107, 30); lastText = MainGraphics.GetActualRectangle(0, 86, 107, 30); canvas.DrawRect(firstRect, _redFill); canvas.DrawRect(lastRect, _redFill); canvas.DrawBorderText("Double", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, firstPaint, _borderTextPaint !, firstText); canvas.DrawBorderText("Trouble", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, middlePaint, _borderTextPaint !, middleText); canvas.DrawBorderText("Double", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Start, firstPaint, _borderTextPaint !, lastText); }
public void DrawImage(SKCanvas canvas, SKRect rect_Card) { var firstHeight = MainGraphics !.GetFontSize(40); var firstWidth = MainGraphics.GetFontSize(16); var firstRect = SKRect.Create(MainGraphics.Location.X, MainGraphics.Location.Y, rect_Card.Width, firstHeight); DrawValue(canvas, firstRect); var otherLocation = new SKPoint(MainGraphics.Location.X, firstRect.Bottom); var pointList = ImageHelpers.GetPoints(EnumShapes.Balls, HowManyBalls, otherLocation, false, firstWidth); var testSize = new SKSize(firstWidth, firstWidth); foreach (var thisPoint in pointList) { var testRect = SKRect.Create(thisPoint, testSize); canvas.DrawOval(testRect, _redPaint); canvas.DrawOval(testRect, _blackBorder); } pointList = ImageHelpers.GetPoints(EnumShapes.Cones, HowManyCones, otherLocation, false, firstWidth); foreach (var thisPoint in pointList) { var testRect = SKRect.Create(thisPoint, testSize); ImageHelpers.DrawCone(canvas, testRect); } pointList = ImageHelpers.GetPoints(EnumShapes.Cubes, HowManyCubes, otherLocation, false, firstWidth); foreach (var thisPoint in pointList) { var testRect = SKRect.Create(thisPoint, testSize); ImageHelpers.DrawCube(canvas, testRect); } pointList = ImageHelpers.GetPoints(EnumShapes.Stars, HowManyStars, otherLocation, false, firstWidth); foreach (var thisPoint in pointList) { var testRect = SKRect.Create(thisPoint, testSize); canvas.DrawStar(testRect, _yellowPaint !, _blackBorder !); } }
private void DrawProperties(SKCanvas thisCanvas) // this is a big one. { SKPaint fillColor; SKColor foreColor; // used for textpaint. string text1; string text2; switch (CardValue) { case 19: { text1 = "Medit Avenue"; fillColor = _purplePaint !; foreColor = SKColors.White; text2 = "1 of 2"; break; } case 20: { text1 = "Baltic Avenue"; fillColor = _purplePaint !; foreColor = SKColors.White; text2 = "2 of 2"; break; } case 21: { text1 = "Oriental Avenue"; fillColor = _aquaPaint !; foreColor = SKColors.Black; text2 = "1 of 3"; break; } case 22: { text1 = "Vermont Avenue"; fillColor = _aquaPaint !; foreColor = SKColors.Black; text2 = "2 of 3"; break; } case 23: { text1 = "Connect Avenue"; fillColor = _aquaPaint !; foreColor = SKColors.Black; text2 = "3 of 3"; break; } case 24: { text1 = "Charles Avenue"; fillColor = _fuchsiaPaint !; foreColor = SKColors.Black; text2 = "1 or 3"; break; } case 25: { text1 = "States Avenue"; fillColor = _fuchsiaPaint !; foreColor = SKColors.Black; text2 = "2 of 3"; break; } case 26: { text1 = "Virginia Avenue"; fillColor = _fuchsiaPaint !; foreColor = SKColors.Black; text2 = "3 of 3"; break; } case 27: { text1 = "James Place"; fillColor = _darkOrangePaint !; foreColor = SKColors.Black; text2 = "1 of 3"; break; } case 28: { text1 = "Tenn Avenue"; fillColor = _darkOrangePaint !; foreColor = SKColors.Black; text2 = "2 of 3"; break; } case 29: { text1 = "York Avenue"; fillColor = _darkOrangePaint !; foreColor = SKColors.Black; text2 = "3 of 3"; break; } case 30: { text1 = "Kentucky Avenue"; fillColor = _redPaint !; foreColor = SKColors.White; text2 = "1 of 3"; break; } case 31: { text1 = "Indiana Avenue"; fillColor = _redPaint !; foreColor = SKColors.White; text2 = "2 to 3"; break; } case 32: { text1 = "Illinois Avenue"; fillColor = _redPaint !; foreColor = SKColors.White; text2 = "3 of 3"; break; } case 33: { text1 = "Atlantic Avenue"; fillColor = _yellowPaint !; foreColor = SKColors.Black; text2 = "1 of 3"; break; } case 34: { text1 = "Ventor Avenue"; fillColor = _yellowPaint !; foreColor = SKColors.Black; text2 = "2 of 3"; break; } case 35: { text1 = "Marvin Gardens"; fillColor = _yellowPaint !; foreColor = SKColors.Black; text2 = "3 of 3"; break; } case 36: { text1 = "Pacific Avenue"; fillColor = _greenPaint !; foreColor = SKColors.White; text2 = "1 of 3"; break; } case 37: { text1 = "Carolina Avenue"; fillColor = _greenPaint !; foreColor = SKColors.White; text2 = "2 of 3"; break; } case 38: { text1 = "Penn Avenue"; fillColor = _greenPaint !; foreColor = SKColors.White; text2 = "3 of 3"; break; } case 39: { text1 = "Park Place"; fillColor = _darkBluePaint !; foreColor = SKColors.White; text2 = "1 of 2"; break; } case 40: { text1 = "Board Walk"; fillColor = _darkBluePaint !; foreColor = SKColors.White; text2 = "2 of 2"; break; } default: { throw new BasicBlankException("Nothing Found"); } } var firstRect = MainGraphics !.GetActualRectangle(3, 3, 50, 36); thisCanvas.DrawRect(firstRect, fillColor); var thisList = text1.Split(" ").ToCustomBasicList(); var fontSize = MainGraphics.GetFontSize(11); var textPaint = MiscHelpers.GetTextPaint(foreColor, fontSize); textPaint.FakeBoldText = true; if (thisList.Count != 2) { throw new Exception("Needs 2 items"); } int tops; tops = 1; foreach (var thisText in thisList) { var thisRect = MainGraphics.GetActualRectangle(1, tops, 53, 18); thisCanvas.DrawCustomText(thisText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, thisRect, out _); tops += 18; } var secondRect = MainGraphics.GetActualRectangle(0, 37, 55, 35); fontSize = MainGraphics.GetFontSize(15); textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize); textPaint.FakeBoldText = true; thisCanvas.DrawCustomText(text2, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, secondRect, out _); }
public void DrawImage(SKCanvas canvas, SKRect rect_Card) { var tempRect = MainGraphics !.GetActualRectangle(3, 3, 224, 124); canvas.DrawRect(tempRect, _redPaint); var firstRect = MainGraphics.GetActualRectangle(4, 4, 50, 50); canvas.DrawRect(firstRect, _whitePaint); var fontSize = MainGraphics.GetFontSize(14); // can adjust as needed var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize); canvas.DrawCustomText(ThisCombo !.Points.ToString() + " PTS.", TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _); var SecondRect = MainGraphics.GetActualRectangle(56, 4, 170, 50); var temps = MainGraphics.GetFontSize(3); canvas.DrawRoundRect(SecondRect, temps, temps, _yellowPaint); canvas.DrawRoundRect(SecondRect, temps, temps, _thickBorder); firstRect = MainGraphics.GetActualRectangle(56, 4, 170, 16); fontSize = MainGraphics.GetFontSize(16); textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize); textPaint.FakeBoldText = true; canvas.DrawCustomText(ThisCombo.FirstDescription, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _); string firstText; string secondText; var tempList = ThisCombo.SecondDescription.Split("|").ToCustomBasicList(); if (tempList.Count != 2) { throw new Exception("Needs 2 lines of text"); } firstText = tempList.First(); secondText = tempList.Last(); firstRect = MainGraphics.GetActualRectangle(56, 20, 170, 16); textPaint = MiscHelpers.GetTextPaint(SKColors.Black, fontSize); SecondRect = MainGraphics.GetActualRectangle(56, 36, 170, 16); canvas.DrawCustomText(firstText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, firstRect, out _); canvas.DrawCustomText(secondText, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, SecondRect, out _); float diffs; diffs = 44; // i think var finalSize = MainGraphics.GetFontSize(68); float lefts; lefts = 5; var tops = 58; var otherSize = MainGraphics.GetFontSize(42); foreach (var thisItem in ThisCombo.SampleList) { YahtzeeHandsDownGraphicsCP thisCard = new YahtzeeHandsDownGraphicsCP(); thisCard.MainGraphics = new BaseDeckGraphicsCP(); //think. thisCard.MainGraphics.ThisGraphics = thisCard; thisCard.MainGraphics.NeedsToClear = false; thisCard.Init();//hopefully this too. thisCard.MainGraphics.ActualWidth = otherSize; thisCard.MainGraphics.ActualHeight = finalSize; thisCard.MainGraphics.Location = MainGraphics.GetActualPoint(new SKPoint(lefts, tops)); thisCard.Color = thisItem.Color; thisCard.IsWild = thisItem.IsWild; thisCard.FirstValue = thisItem.FirstValue; thisCard.SecondValue = thisItem.SecondValue; thisCard.MainGraphics.DrawImage(canvas); lefts += diffs; } }