Example #1
0
        protected override void SetUpPaints()
        {
            _bitPaint = MiscHelpers.GetBitmapPaint();
            Assembly thisA = Assembly.GetAssembly(GetType());

            _thisBit        = ImageExtensions.GetSkBitmap(thisA, "SorryGameBoard.png");
            _highlightPaint = MiscHelpers.GetStrokePaint(SKColors.Fuchsia, 3);
        }
 protected override void SetUpPaints()
 {
     _thisA       = Assembly.GetAssembly(GetType());
     _bitPaint    = MiscHelpers.GetBitmapPaint();
     _thisBit     = ImageExtensions.GetSkBitmap(_thisA, "gameboard.png");
     _blackBorder = MiscHelpers.GetStrokePaint(SKColors.Black, 4);
     _aquaBorder  = MiscHelpers.GetStrokePaint(SKColors.Aqua, 4);
     _limeBorder  = MiscHelpers.GetStrokePaint(SKColors.LimeGreen, 4);
 }
Example #3
0
        protected override void SetUpPaints()
        {
            Assembly thisA = Assembly.GetAssembly(GetType());

            _fillPaint   = MiscHelpers.GetSolidPaint(SKColors.LightGray);
            _borderPaint = MiscHelpers.GetStrokePaint(SKColors.White, 3);         // try 3
            _publicBit   = ImageExtensions.GetSkBitmap(thisA, "publictrain.png");
            _playerBit   = ImageExtensions.GetSkBitmap(thisA, "playertrain.png"); // for testing, will be this one.
            _bitPaint    = MiscHelpers.GetBitmapPaint();
            _redPaint    = MiscHelpers.GetSolidPaint(SKColors.Red);
        }
        public LilyPadCP(int x, int y, bool pHasFrog)
        {
            Column  = x;
            Row     = y;
            HasFrog = pHasFrog;
            Assembly temps = Assembly.GetAssembly(GetType());

            _img_LilyPad = ImageExtensions.GetSkBitmap(temps, "leaf.png");
            _img_Frog    = ImageExtensions.GetSkBitmap(temps, "frog.png");
            _bitPaint    = MiscHelpers.GetBitmapPaint();
        }
Example #5
0
        public void PaintBoard(SKCanvas canvas)
        {
            if (_spaceList.Count == 0)
            {
                return;
            }
            canvas.Clear();
            foreach (var ThisItem in _spaceList.Values)
            {
                DrawSpace(canvas, ThisItem);
            }
            var thisBit  = ImageExtensions.GetSkBitmap(_thisAssembly, "snakeladder.png");
            var thisRect = SKRect.Create(0, 0, HeightWidth * 10, HeightWidth * 10);

            canvas.DrawBitmap(thisBit, thisRect, _bitPaint);
        }
        private void CreatePaints(int width)
        {
            Assembly thisA = Assembly.GetAssembly(GetType());

            _bitPaint        = MiscHelpers.GetBitmapPaint();
            _arrowImage      = ImageExtensions.GetSkBitmap(thisA, "arrows.png");
            _highSpeed1      = ImageExtensions.GetSkBitmap(thisA, "highspeed1.png");
            _highSpeed2      = ImageExtensions.GetSkBitmap(thisA, "highspeed2.png");
            _boardBit        = ImageExtensions.GetSkBitmap(thisA, "spinner.png");
            _actualBoardSize = width; // try this way
            var diffs = _actualBoardSize / _intendedBoardSize;

            _actualArrowHeight = _intendedArrowHeight * diffs;
            _actualArrowWidth  = _intendedArrowWidth * diffs;
            _didPaint          = true;
        }
        public PieceCP()
        {
            Assembly thisA = Assembly.GetAssembly(GetType());

            _blueBishop = ImageExtensions.GetSkBitmap(thisA, "BLUEBISHOP.gif");
            _blueKing   = ImageExtensions.GetSkBitmap(thisA, "BLUEKING.gif");
            _blueKnight = ImageExtensions.GetSkBitmap(thisA, "BLUEKNIGHT.gif");
            _bluePawn   = ImageExtensions.GetSkBitmap(thisA, "BLUEPAWN.gif");
            _blueQueen  = ImageExtensions.GetSkBitmap(thisA, "BLUEQUEEN.gif");
            _blueRook   = ImageExtensions.GetSkBitmap(thisA, "BLUEROOK.gif");
            _redBishop  = ImageExtensions.GetSkBitmap(thisA, "REDBISHOP.gif");
            _redKing    = ImageExtensions.GetSkBitmap(thisA, "REDKING.gif");
            _redKnight  = ImageExtensions.GetSkBitmap(thisA, "REDKNIGHT.gif");
            _redPawn    = ImageExtensions.GetSkBitmap(thisA, "REDPAWN.gif");
            _redQueen   = ImageExtensions.GetSkBitmap(thisA, "REDQUEEN.gif");
            _redRook    = ImageExtensions.GetSkBitmap(thisA, "REDROOK.gif");
            _bitPaint   = MiscHelpers.GetBitmapPaint();
        }
Example #8
0
        public void Init()
        {
            MainGraphics !.OriginalSize = new SKSize(55, 72); //change to what the original size is.
            _thisAssembly = Assembly.GetAssembly(this.GetType());
            SKColor ThisColor  = SKColors.Black;
            SKColor OtherColor = new SKColor(ThisColor.Red, ThisColor.Green, ThisColor.Blue, 70); //can experiment as needed.

            _selectPaint = MiscHelpers.GetSolidPaint(OtherColor);
            ThisColor    = SKColors.White;
            OtherColor   = new SKColor(ThisColor.Red, ThisColor.Green, ThisColor.Blue, 150);
            _pDrewPaint  = MiscHelpers.GetSolidPaint(OtherColor);
            _cutImage    = ImageExtensions.GetSkBitmap(_thisAssembly, "cut.png");
            _flipImage   = ImageExtensions.GetSkBitmap(_thisAssembly, "flip.png");
            _redBrush    = MiscHelpers.GetSolidPaint(SKColors.Red);
            _yellowBrush = MiscHelpers.GetSolidPaint(SKColors.Yellow);
            _blueBrush   = MiscHelpers.GetSolidPaint(SKColors.Blue);
            _greenBrush  = MiscHelpers.GetSolidPaint(SKColors.Green);
            _textBorder  = MiscHelpers.GetStrokePaint(SKColors.Black, 2);
            _backPaint   = MiscHelpers.GetSolidPaint(SKColors.Aqua);
        }
Example #9
0
        public void DrawImage(SKCanvas canvas, SKRect rect_Card)
        {
            Assembly thisA     = Assembly.GetAssembly(GetType());
            int      tempValue = (int)CardValue;
            var      thisImage = ImageExtensions.GetSkBitmap(thisA, "card" + tempValue.ToString() + ".png");
            var      tempRect  = SKRect.Create(5, 5, rect_Card.Width - 10, rect_Card.Height * 0.65f);

            canvas.DrawBitmap(thisImage, tempRect, MainGraphics !.BitPaint);
            var textPaint = MiscHelpers.GetTextPaint(SKColors.Black, rect_Card.Height * 0.2f);

            tempRect = SKRect.Create(0, tempRect.Bottom, rect_Card.Width, rect_Card.Height * 0.3f);
            string text = "";

            switch (CardValue)
            {
            case EnumCardValues.BallRoom:
            {
                text = "Ball";
                break;
            }

            case EnumCardValues.BilliardRoom:
            {
                text = "Billiard";
                break;
            }

            case EnumCardValues.Candlestick:
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Black, rect_Card.Height * 0.14f);
                text      = "Candlestick";
                break;
            }

            case EnumCardValues.Colonel:
            {
                text = "Mustard";
                break;
            }

            case EnumCardValues.Conservatory:
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Black, rect_Card.Height * 0.12f);
                text      = "Convervatory";
                break;
            }

            case EnumCardValues.DiningRoom:
            {
                text = "Dining";
                break;
            }

            case EnumCardValues.Green:
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Black, rect_Card.Height * 0.15f);
                text      = "Mr. Green";
                break;
            }

            case EnumCardValues.Hall:
            {
                text = "Hall";
                break;
            }

            case EnumCardValues.Kitchen:
            {
                text = "Kitchen";
                break;
            }

            case EnumCardValues.Knife:
            {
                text = "Knife";
                break;
            }

            case EnumCardValues.LeadPipe:
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Black, rect_Card.Height * 0.15f);
                text      = "Lead Pipe";
                break;
            }

            case EnumCardValues.Library:
            {
                text = "Library";
                break;
            }

            case EnumCardValues.Lounge:
            {
                text = "Lounge";
                break;
            }

            case EnumCardValues.Peacock:
            {
                text = "Peacock";
                break;
            }

            case EnumCardValues.Plum:
            {
                textPaint = MiscHelpers.GetTextPaint(SKColors.Black, rect_Card.Height * 0.15f);
                text      = "Prof. Plum";
                break;
            }

            case EnumCardValues.Revolver:
            {
                text = "Revolver";
                break;
            }

            case EnumCardValues.Rope:
            {
                text = "Rope";
                break;
            }

            case EnumCardValues.Scarlet:
            {
                text = "Scarlet";
                break;
            }

            case EnumCardValues.Study:
            {
                text = "Study";
                break;
            }

            case EnumCardValues.White:
            {
                text = "White";
                break;
            }

            case EnumCardValues.Wrench:
            {
                text = "Wrench";
                break;
            }
            }
            canvas.DrawCustomText(text, TextExtensions.EnumLayoutOptions.Center, TextExtensions.EnumLayoutOptions.Center, textPaint, tempRect, out _);
        }