예제 #1
0
        private void DrawTsumoTile(int Index, int Tile, string Comment, bool Tsumogiri, bool Danger)
        {
            int X = PaddingH + RoundColumnWidth + PlayerColumnWidth + InternalPadding + (Column) * TileWidth;
            int Y = Index * FieldHeight + PaddingV + InternalPadding + (TileHeight * 2);

            if (Tsumogiri) Tile = -2;

            PaifuTileImage TileImage = new PaifuTileImage(Tile, Scale, Red);

            if (Danger && !Tsumogiri && (ShowDanger != 0)) TileImage.Colorize(DangerColor);
            Bitmap TileBitmap = TileImage.Bmp;

            G.DrawImage(TileBitmap, new Point(X, Y));

            DrawCenteredString(Color.Black, Fcomment, Comment, new PointF(X, Y - G.MeasureString(Comment, Fcomment).Height), TileWidth);
        }
예제 #2
0
        private void DrawDiscardTile(int Index, int Tile, string Comment, bool Danger, bool Furiten, int Shanten)
        {
            int X = PaddingH + RoundColumnWidth + PlayerColumnWidth + InternalPadding + (Column) * TileWidth;
            int Y = Index * FieldHeight + PaddingV + InternalPadding + (TileHeight * 3);

            PaifuTileImage TileImage = new PaifuTileImage(Tile, Scale, Red);
            if (Danger && (ShowDanger != 0))
                TileImage.Colorize(DangerColor);
            Bitmap TileBitmap = TileImage.Bmp;

            G.DrawImage(TileBitmap, new Point(X, Y));
            DrawCenteredString(Color.Black, Fcomment, Comment, new PointF(X, Y + TileHeight), TileWidth);

            if (ShowShanten != 0)
            {
                if (Furiten)
                {
                    Brush Gray = new SolidBrush(Color.FromArgb(200, Color.Black));

                    G.FillRectangle(Gray, X, Y + TileBitmap.Height, TileBitmap.Width, TileBitmap.Height / 10);
                }
                else if ((Shanten >= 0) && (Shanten < ShantenColor.Length))
                {
                    if (ShowColor != 0)
                    {
                        Brush BrColor = new SolidBrush(ShantenColor[Shanten]);

                        G.FillRectangle(BrColor, X, Y + TileBitmap.Height, TileBitmap.Width, TileBitmap.Height / 10);
                    }
                    if ((Comment.CompareTo("") == 0) && (Shanten > 0)) DrawCenteredString(Color.Black, Fcomment, Shanten.ToString(), new PointF(X, Y + TileHeight), TileWidth);
                }
            }
        }
예제 #3
0
        private int DrawHandTile(int Index, int Tile, int Pos, int Line, int YOffset, RotateFlipType Rotate, bool Danger)
        {
            PaifuTileImage TileImage = new PaifuTileImage(Tile, Scale, Red);
            if (Danger && (ShowDanger != 0))
                TileImage.Colorize(DangerColor);
            Bitmap TileBitmap = TileImage.Bmp;

            switch (Rotate)
            {
                case RotateFlipType.Rotate90FlipNone: TileBitmap.RotateFlip(Rotate); break;
                case RotateFlipType.Rotate270FlipNone: TileBitmap.RotateFlip(Rotate); break;
            }

            int X = PaddingH + RoundColumnWidth + PlayerColumnWidth + InternalPadding + Pos + TileWidth;
            int Y = Index * FieldHeight + PaddingV + InternalPadding + (TileHeight * Line) + YOffset + TileHeight - TileBitmap.Height;

            G.DrawImage(TileBitmap, new Point(X, Y));

            return Pos + TileBitmap.Width;
        }