Exemplo n.º 1
0
        /// <summary>
        /// 绘制背景,前景,移动点
        /// </summary>
        protected virtual void ShowMapUI_Paint(object sender, PaintEventArgs e)
        {
            if (BoxGame == null)
            {
                return;
            }
            List <uint> layerList = new List <uint>();

            ShowLayerEdit(layerList);
            layerList.Sort();//按层次依次显示
            //显示层次中物体
            foreach (uint layer in layerList)
            {
                foreach (KeyValuePair <Point, BoxItem> item in BoxGame.LayerMapDict[layer])
                {
                    BoxItem bbItem = item.Value;
                    if (item.Value == null)
                    {
                        continue;
                    }
                    Rectangle rectangle = new Rectangle(item.Key.X * unit + BorderUnit, item.Key.Y * unit + BorderUnit, unit, unit);
                    if (layer == (uint)LayerOptions.Role)
                    {
                        e.Graphics.DrawImage(ImageManager.Instance[bbItem.GetImgName(this.boxGame.CharacterDirection, this.boxGame.CharacterTimerCount)], rectangle);
                    }
                    else
                    {
                        e.Graphics.DrawImage(ImageManager.Instance[bbItem.DefaultImg], rectangle);
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void InitImage()
 {
     if (boxItem == null)
     {
         return;
     }
     this.peMain.Image = ImageManager.Instance[boxItem.GetImgName(this.ShowDirection, this.showIndex)];
     this.peMain.Image = new Bitmap(this.peMain.Image, new Size(this.peMain.Width - 3, this.peMain.Height - 3));
 }