Beispiel #1
0
        /// <summary>
        /// 绘制过场动画
        /// </summary>
        protected override void ReDraw()
        {
            Graphics.FromImage(WindowFace).Clear(Color.Transparent);
            
            if (Valid)
            {
                Bitmap temp = new Bitmap(FlashPicture);
                Graphics.FromImage(temp).DrawString("魔 塔", new Font(new FontFamily("宋体"), 30, FontStyle.Bold), new SolidBrush(Color.Black), new PointF(70, 70));
                Graphics.FromImage(temp).DrawString(Message.Mesg, new Font(new FontFamily("宋体"), 28, FontStyle.Bold), new SolidBrush(Color.Black), new PointF(50, 110));

                temp.SetOpacity(Opacity);
                Graphics.FromImage(WindowFace).DrawImage(temp, FrmMain.DesWindow, new Rectangle(new Point(0, 0), FlashPicture.Size), GraphicsUnit.Pixel);
                TimeCount++;
            }  
        }
Beispiel #2
0
        /// <summary>
        /// 初始加载固有图像,但标准单位尺寸分隔
        /// </summary>
        static MotaImage()
        {
            BackImage = new Bitmap("images/map/Empty1.png");
            SelectedBackImage = GetImage(MotaElement.选中怪物背景);
            SelectedBackImage.SetOpacity(0.4F);

            BackWindow = new Bitmap("images/back.png");

            for (int i = 0; i < ImageVector.Length; i++)
            {
                MotaElement id = (MotaElement)i;
                ImageVector[i] = GetFaceList(GetImage(id), new Size(GameIni.ElementWidth, GameIni.ElementHeight));
            }
        }
Beispiel #3
0
        /// <summary>
        /// 绘制怪物数据到窗口
        /// </summary>
        protected override void ReDraw()
        {
            Canvas = new Bitmap(WindowFace);
            Graphics g = Graphics.FromImage(Canvas);
            g.Clear(Color.Black);

            Font strFont = new Font("幼圆", 12, FontStyle.Bold);
            SolidBrush strBrush = new SolidBrush(Color.White);
            
            g.DrawString("怪物手册", new Font("宋体", 18, FontStyle.Bold), strBrush, new PointF(220, 10));

            OneFlash(null, null);

            //逐一绘制怪物属性
            int trun = 0;
            IEnumerable<ICanShowData> curMonsters = CurMonsters;
            foreach (var item in curMonsters)
            {
                DrawMonsterData(g, trun, item);

                trun++;
            }

            //绘制说明信息
            g.DrawString("按space返回主游戏页面", strFont, strBrush, new PointF(190, 420));

            g.DrawString(curPage.ToString() + " / " + MaxPage.ToString(), strFont, strBrush, new PointF(460, 420));
            try
            {
                //如果当前页数大于1,绘制向左翻页的提示
                if (CurPage > 1)
                {
                    g.DrawImage(new Bitmap("images/left.png"), new Point(440, 418));
                }
                //如果当前页数小于最大页数,绘制向右翻页提示
                if (curPage < MaxPage)
                {
                    g.DrawImage(new Bitmap("images/right.png"), new Point(508, 418));
                }
            }
            catch 
            {
            }

            Canvas.SetOpacity(0.90F);
            WindowFace = Canvas;
        }
Beispiel #4
0
        /// <summary>
        /// 从对话队列中取出一次对话,绘制此对话到画布
        /// 如果对话队列为空,则关闭对话框
        /// </summary>
        protected override void ReDraw()
        {
            //取出一次对话
            Dialogue oneDialogue = DialogueQueue.Dequeue();

            Bitmap canvas = new Bitmap(WindowFace);
            Graphics g = Graphics.FromImage(canvas);
            
            Font strFont = new Font(new FontFamily("微软雅黑"), 12, FontStyle.Regular);
            SolidBrush strBrush = new SolidBrush(Color.Black);

            //绘制人物栏
            g.DrawImage(MotaImage.BackWindow, new Rectangle(0, 0, 80, 30), new Rectangle(0, 0, MotaImage.BackWindow.Width, MotaImage.BackWindow.Height), GraphicsUnit.Pixel);
            //g.FillRectangle(new SolidBrush(Color.Aquamarine), new Rectangle(0, 0, 80, 30));
            g.DrawString(oneDialogue.Speaker, strFont, strBrush, new PointF(10, 5));

            //绘制会话栏
            g.DrawImage(MotaImage.BackWindow, new Rectangle(0, 35, GameIni.DialogueSize.Width - 5, GameIni.DialogueSize.Height - 40), new Rectangle(0, 0, MotaImage.BackWindow.Width, MotaImage.BackWindow.Height), GraphicsUnit.Pixel);
            //g.FillRectangle(new SolidBrush(Color.Aquamarine), new Rectangle(0, 35, GameIni.DialogueSize.Width - 5, GameIni.DialogueSize.Height - 40));
            g.DrawString(oneDialogue.Content, strFont, strBrush, new Rectangle(10, 45, 320, 100));

            canvas.SetOpacity(0.8F);
            WindowFace = canvas;
        }
Beispiel #5
0
        /// <summary>
        /// 绘制跳转界面到画布
        /// </summary>
        protected override void ReDraw()
        {
            Bitmap canvas = new Bitmap(WindowFace);
            Graphics.FromImage(canvas).DrawImage(MotaImage.BackWindow, new Rectangle(0, 0, this.WindowFace.Width, this.WindowFace.Height), new Rectangle(0, 0, MotaImage.BackWindow.Width, MotaImage.BackWindow.Height), GraphicsUnit.Pixel);
            
            //绘制文字
            Font descFont = new Font(new FontFamily("微软雅黑"), 13, FontStyle.Regular);
            SolidBrush descBrush = new SolidBrush(Color.Black);
            Graphics.FromImage(canvas).DrawString("请选择您要跳转的楼层", descFont, descBrush, new PointF(40, 10));

            //绘制楼层信息
            int index = 0;
            for (int i = 0; i < GameIni.SkipWindowCol; i++)
            {
                for (int j = 0; j < GameIni.SkipWindowRow; j++)
                {
                    if (Options.Count <= index)
                    {
                        break;
                    }

                    Options[index++].Draw(Graphics.FromImage(canvas), new Point(i * (GameIni.FloorUnit.Width + 20) + 25, 50 + j * (20 + GameIni.FloorUnit.Height)));  
                }
                if (Options.Count <= index)
                {
                    break;
                }
            }

            canvas.SetOpacity(0.8F);
            WindowFace = canvas;
        }