Exemple #1
0
        /// <summary>
        /// Desenha a caixa de mensagem.
        /// </summary>
        public static void Draw()
        {
            if (!Visible)
            {
                return;
            }

            if (Enabled == false)
            {
                if (Environment.TickCount >= tick + 10000)
                {
                    Text    = "Sem conexão";
                    Enabled = true;
                    Common.Configuration.HexID = "";
                    Common.Configuration.IPAddress[(int)NetworkSocketEnum.GameServer] = new IPAddress(string.Empty, 0);
                }
            }

            background.Transparency = Transparency;
            button.Transparency     = Transparency;

            background.Draw();

            EngineFont.DrawText(null, Text, new Size2(480, 80), new Point(Position.X, Position.Y - 1), new SharpDX.Color(Color.White.R, Color.White.G, Color.White.B, Transparency), EngineFontStyle.Regular, FontDrawFlags.Left);
            button.Draw();
        }
        /// <summary>
        /// Desenha o controle na tela.
        /// </summary>
        /// <param name="text"></param>
        public void Draw(string text)
        {
            if (!Visible)
            {
                return;
            }
            if (Transparency == 0)
            {
                return;
            }

            MouseButtons();

            if (DrawTexture == false)
            {
                return;
            }

            EngineCore.SpriteDevice.Begin(SpriteFlags);
            //Desenha o fundo
            EngineCore.SpriteDevice.Draw(textureBack, new Color(Color.R, Color.G, Color.B, Transparency), SourceRect, new Vector3(0, 0, 0), new Vector3(Position.X, Position.Y, 0));
            //Desenha o progresso
            EngineCore.SpriteDevice.Draw(textureColor, new Color(Color.R, Color.G, Color.B, Transparency), new Rectangle(0, 0, Size.Width * Percentage / 100, Size.Height), new Vector3(0, 0, 0), new Vector3(Position.X, Position.Y, 0));
            //Desenha o restante
            EngineCore.SpriteDevice.Draw(Texture, new Color(Color.R, Color.G, Color.B, Transparency), SourceRect, new Vector3(0, 0, 0), new Vector3(Position.X, Position.Y, 0));
            EngineCore.SpriteDevice.End();

            if (DrawText == false)
            {
                return;
            }

            EngineFont.DrawText(null, text, new Size2(519, 0), new Point(Position.X, Position.Y + 22), Color.White, EngineFontStyle.Regular, FontDrawFlags.Center);
        }
Exemple #3
0
        public void Draw()
        {
            if (!Visible)
            {
                return;
            }
            if (Transparency == 0)
            {
                return;
            }
            if (Sprite == 0)
            {
                return;
            }

            MouseButtons();

            ProcessMovement();
            ProcessAnimation();

            EngineCore.SpriteDevice.Begin(SpriteFlags);
            EngineCore.SpriteDevice.Draw(SpriteManager.FindByID(Sprite), new Color(Color.R, Color.G, Color.B, Transparency), SourceRect, new Vector3(0, 0, 0), new Vector3(PositionX, PositionY, 0));
            EngineCore.SpriteDevice.End();

            //Shadow
            //EngineCore.SpriteDevice.Begin(SpriteFlags);
            //EngineCore.SpriteDevice.Draw(ResourceSprite.FindByID(Sprite), new Color(ShadowColor.R, ShadowColor.G, ShadowColor.B, ShadowTransparency), SourceRect, new Vector3(-20, 10, 0), new Vector3(PositionX, PositionY, 0));
            //EngineCore.SpriteDevice.End();

            EngineFont.DrawText(null, Name, new Size2(30, 0), new Point(PositionX, PositionY - 5), Color.White, EngineFontStyle.Regular, FontDrawFlags.Center);
            EngineFont.DrawText(null, Legion, new Size2(30, 0), new Point(PositionX, PositionY - 20), Color.BlueViolet, EngineFontStyle.Bold, FontDrawFlags.Center);
        }
Exemple #4
0
        public void Draw()
        {
            if (!Visible)
            {
                return;
            }
            if (Transparency == 0)
            {
                return;
            }
            if (Sprite == 0)
            {
                return;
            }

            MouseButtons();

            ProcessMovement();
            ProcessAnimation();

            EngineCore.SpriteDevice.Begin(SpriteFlags);
            EngineCore.SpriteDevice.Draw(EngineTexture.FindTextureByID(Sprite, EngineTextureType.Sprites), new Color(Color.R, Color.G, Color.B, Transparency), SourceRect, new Vector3(0, 0, 0), new Vector3(PositionX, PositionY, 0));
            EngineCore.SpriteDevice.End();

            EngineFont.DrawText(Name, new Size2(30, 0), new Point(PositionX, PositionY - 5), Color.White, EngineFontStyle.Regular, FontDrawFlags.Center);
            EngineFont.DrawText(Legion, new Size2(30, 0), new Point(PositionX, PositionY - 20), Color.BlueViolet, EngineFontStyle.Bold, FontDrawFlags.Center);
        }
Exemple #5
0
 /// <summary>
 /// Desenha o texto.
 /// </summary>
 public void DrawText()
 {
     if (!TextVisible)
     {
         return;
     }
     EngineFont.DrawText(null, Text, Position.X, Position.Y, new Color(TextColor.R, TextColor.R, TextColor.B, TextTransparency), TextFontStyle);
 }
Exemple #6
0
 /// <summary>
 /// Desenha o texto no centro do controle.
 /// </summary>
 public void DrawTextCenter()
 {
     if (!TextVisible)
     {
         return;
     }
     EngineFont.DrawText(null, Text, Size, new Point(Position.X, Position.Y + 4), new Color(TextColor.R, TextColor.R, TextColor.B, TextTransparency), TextFontStyle, FontDrawFlags.Left, false);
 }
        /// <summary>
        /// Desenha o texto.
        /// </summary>
        /// <param name="text"></param>
        public void DrawText(string text)
        {
            if (!TextVisible)
            {
                return;
            }

            EngineFont.DrawText(text, new Rectangle(Position.X + TextPosition.X, Position.Y + TextPosition.Y, Size.Width, Size.Height), _textColor, TextFontStyle, FontDrawFlags);
        }
        /// <summary>
        /// Desenha o texto.
        /// </summary>
        public void DrawText()
        {
            if (!TextVisible)
            {
                return;
            }

            EngineFont.DrawText(Text, Position.X + TextPosition.X, Position.Y + TextPosition.Y, _textColor, TextFontStyle);
        }
        /// <summary>
        /// Desenha o texto no controle.
        /// </summary>
        public void DrawText()
        {
            DrawCursor();

            if (Password)
            {
                EngineFont.DrawText(PasswordText + Cursor, Position.X + 10, Position.Y + 4, _textColor, EngineFontStyle.Regular);
            }
            else
            {
                EngineFont.DrawText(Text + Cursor, Position.X + 10, Position.Y + 4, _textColor, EngineFontStyle.Regular);
            }
        }
        /// <summary>
        /// Desenha o texto no controle.
        /// </summary>
        public void DrawText()
        {
            DrawCursor();

            if (Password)
            {
                EngineFont.DrawText(null, PasswordText + Cursor, Position.X + 10, Position.Y + 4, new Color(TextColor.R, TextColor.G, TextColor.B, TextTransparency), EngineFontStyle.Regular);
            }
            else
            {
                EngineFont.DrawText(null, Text + Cursor, Position.X + 10, Position.Y + 4, new Color(TextColor.R, TextColor.G, TextColor.B, TextTransparency), EngineFontStyle.Regular);
            }
        }
        /// <summary>
        /// Executa a lógica e desenha o controle.
        /// </summary>
        public static void Draw()
        {
            if (!Visible)
            {
                return;
            }
            background.Draw();

            button[0].Draw();
            button[1].Draw();

            TextBox.Draw();
            TextBox.DrawTextMesured();

            EngineFont.DrawText(Text, new Size2(400, 100), new Point(Position.X, Position.Y - 15), new Color(Color.White.R, Color.White.G, Color.White.B, TextTransparency), EngineFontStyle.Regular, FontDrawFlags.Center, false);
        }
        /// <summary>
        /// Desenha o texto centralizado no controle.
        /// </summary>
        public void DrawTextMesured()
        {
            DrawCursor();

            if (Password)
            {
                rec_cursor = EngineFont.MeasureString(null, EngineFontStyle.Regular, PasswordText, TextFormat);
                EngineFont.DrawText(null, PasswordText, Size, new Point(Position.X, Position.Y + 4), new Color(TextColor.R, TextColor.G, TextColor.B, TextTransparency), EngineFontStyle.Regular, TextFormat);
            }
            else
            {
                rec_cursor = EngineFont.MeasureString(null, EngineFontStyle.Regular, Text, TextFormat);
                EngineFont.DrawText(null, Text, Size, new Point(Position.X, Position.Y + 4), new Color(TextColor.R, TextColor.G, TextColor.B, TextTransparency), EngineFontStyle.Regular, TextFormat, false);
            }

            EngineFont.DrawText(null, Cursor, Position.X + ((Size.Width - rec_cursor.Width) / 2) + rec_cursor.Width, Position.Y + 4, new Color(TextColor.R, TextColor.G, TextColor.B, TextTransparency), EngineFontStyle.Regular);
        }
Exemple #13
0
        public static void Render()
        {
            if (Device == null)
            {
                return;
            }

            Device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);
            Device.BeginScene();

            background.Draw();

            if (GameState == 1)
            {
                //   WindowTalent.Visible = true;
                //   WindowTalent.Draw();
                // WindowViewTalent.Draw();
                WindowLogin.Draw();
            }
            if (GameState == 2)
            {
                WindowServer.Draw();
            }
            if (GameState == 3)
            {
                WindowCharacter.Draw(); WindowPin.Draw();
            }
            if (GameState == 4)
            {
                WindowNewCharacter.Draw();
            }
            if (GameState == 6)
            {
                WindowGame.Draw();
            }

            EngineInputBox.Draw();
            EngineMessageBox.Draw();

            EngineFont.DrawText("FPS: " + FPS, 925, 0, Color.Coral, EngineFontStyle.Bold);
            EngineFont.DrawText("Ping: " + Common.Configuration.Latency, 5, 0, Color.Coral, EngineFontStyle.Bold);

            Device.EndScene();
            Device.Present();
        }
        /// <summary>
        /// Desenha o texto centralizado no controle.
        /// </summary>
        public void DrawTextMesured()
        {
            DrawCursor();

            if (Password)
            {
                rec_cursor = EngineFont.MeasureString(EngineFontStyle.Regular, PasswordText, TextFormat);
                EngineFont.DrawText(PasswordText, Size, new Point(Position.X, Position.Y + 4), _textColor, EngineFontStyle.Regular, TextFormat);
            }
            else
            {
                rec_cursor = EngineFont.MeasureString(EngineFontStyle.Regular, Text, TextFormat);
                EngineFont.DrawText(Text, Size, new Point(Position.X, Position.Y + 4), _textColor, EngineFontStyle.Regular, TextFormat, false);
            }

            TextPosition = new Point(Position.X + ((Size.Width - rec_cursor.Width) / 2) + rec_cursor.Width, Position.Y + 4);

            EngineFont.DrawText(Cursor, Position.X + ((Size.Width - rec_cursor.Width) / 2) + rec_cursor.Width, Position.Y + 4, _textColor, EngineFontStyle.Regular);
        }
Exemple #15
0
        /// <summary>
        /// Desenha os controles.
        /// </summary>
        public void Draw()
        {
            if (!Visible)
            {
                return;
            }
            if (Transparency == 0)
            {
                return;
            }

            MouseButtons();

            KeyState();
            ProcessMovement();
            ProcessAnimation();

            EngineCore.SpriteDevice.Begin(SpriteFlags.AlphaBlend);
            EngineCore.SpriteDevice.Draw(SpriteManager.FindByID(Sprite), new Color(Color.R, Color.G, Color.B, Transparency), source_rect, new Vector3(0, 0, 0), new Vector3(X, Y, 0));
            EngineCore.SpriteDevice.End();

            EngineFont.DrawText(null, Name, new Size2(30, 0), new Point(X, Y - 5), Color.White, EngineFontStyle.Regular, FontDrawFlags.Center);
            EngineFont.DrawText(null, Guild, new Size2(30, 0), new Point(X, Y - 20), Color.BlueViolet, EngineFontStyle.Bold, FontDrawFlags.Center);
        }