Ejemplo n.º 1
0
        private void doubleBuffedPanel1_Paint(object sender, PaintEventArgs e)
        {
            if (!showImage)
            {
                return;
            }

            tileManager.Draw(e.Graphics, baseX, baseY, doubleBuffedPanel1.Width, doubleBuffedPanel1.Height);
            battleManager.Draw(e.Graphics, baseX, baseY, stage == ControlStage.Move ? moveId : 0);//ws处理SelectMove阶段显示人物

            DrawMoveRegion(e);

            chessMoveAnim.Draw(e.Graphics, baseX, baseY);

            if (selectCellPos.X >= 0 && selectCellPos.Y >= 0)
            {
                var px = selectCellPos.X * TileManager.CellSize - baseX;
                var py = selectCellPos.Y * TileManager.CellSize - baseY;

                if (stage == ControlStage.SelectMove)
                {
                    var selectImg = HSIcons.GetImage("Samurai", battleManager.GetSam(moveId).Cid);

                    e.Graphics.DrawImage(selectImg, new Rectangle(px, py, TileManager.CellSize, TileManager.CellSize), 0, 0,
                                         selectImg.Width, selectImg.Height, GraphicsUnit.Pixel, HSImageAttributes.ToAlphaHalf);

                    if (savedPath.Find(node => node.NowCell.X == selectCellPos.X && node.NowCell.Y == selectCellPos.Y) == null)
                    {
                        e.Graphics.DrawImage(HSIcons.GetSystemImage("rgout"), px + 5, py + 5, TileManager.CellSize - 10, TileManager.CellSize - 10);
                    }
                }
                else
                {
                    var selectImg = HSIcons.GetSystemImage("actmark");
                    e.Graphics.DrawImage(selectImg, px, py, TileManager.CellSize, TileManager.CellSize);
                }
            }

            if (mouseOnId > 0)
            {
                var targetUnit = battleManager.GetSam(mouseOnId);
                var image      = targetUnit.GetPreview();
                int tx         = targetUnit.X * TileManager.CellSize - baseX + TileManager.CellSize;
                if (tx > doubleBuffedPanel1.Width - image.Width)
                {
                    tx -= image.Width + TileManager.CellSize;
                }
                e.Graphics.DrawImage(image, tx, targetUnit.Y * TileManager.CellSize - baseY, image.Width, image.Height);
                image.Dispose();
            }

            effectRun.Draw(e.Graphics);
            textFlow.Draw(e.Graphics);

            battleMenu.Draw(e.Graphics);
        }
Ejemplo n.º 2
0
 private void BasePanel_Paint(object sender, PaintEventArgs e)
 {
     effectRunBase.Draw(e.Graphics);
     textFlow.Draw(e.Graphics);
 }