/// <summary>
 /// Construtor.
 /// </summary>
 public EngineTextBox(string name, int width, int height) : base()
 {
     Cursor           = " ";
     Text             = string.Empty;
     TextColor        = Color.White;
     TextTransparency = byte.MaxValue;
     TextVisible      = true;
     Password         = false;
     PasswordText     = string.Empty;
     Texture          = EngineTexture.TextureFromFile($"{Common.Configuration.GamePath}/Data/Graphics/{name}.png", width, height);
     varTime          = Environment.TickCount;
 }
        /// <summary>
        /// Carrega um novo arquivo com tamanho definido.
        /// </summary>
        /// <param name="file">Arquivo</param>
        /// <param name="width">Comprimento</param>
        /// <param name="height">Altura</param>
        public EngineLabel(string name, int width, int height) : base()
        {
            var language = Enum.GetName(typeof(Language), Common.Configuration.Language);

            Text             = string.Empty;
            TextColor        = Color.White;
            TextVisible      = true;
            TextTransparency = byte.MaxValue;
            TextFontStyle    = EngineFontStyle.Regular;
            Texture          = EngineTexture.TextureFromFile($"{Common.Configuration.GamePath}\\Data\\Graphics\\{name}.png", width, height);
            Size             = new Size2(width, height);
            SourceRect       = new Rectangle(0, 0, width, height);
        }
        /// <summary>
        /// Construtor.
        /// </summary>
        public EngineTextBox(string file, int width, int height)
        {
            Cursor           = " ";
            Text             = string.Empty;
            TextColor        = Color.White;
            TextTransparency = 255;
            TextVisible      = true;
            Password         = false;
            PasswordText     = string.Empty;

            Texture = EngineTexture.TextureFromFile(file, width, height);
            varTime = Environment.TickCount;
        }
Exemple #4
0
        /// <summary>
        /// Carrega um novo arquivo com tamanho definido.
        /// </summary>
        /// <param name="file">Arquivo</param>
        public EngineObject(string file, int width, int height)
        {
            Name         = string.Empty;
            Transparency = byte.MaxValue;
            Visible      = true;
            Enabled      = true;
            Position     = new Point();
            Color        = Color.White;
            SpriteFlags  = SpriteFlags.AlphaBlend;
            Size         = new Size2(width, height);
            SourceRect   = new Rectangle(0, 0, width, height);
            BorderRect   = new Rectangle(0, 0, 0, 0);

            Texture = EngineTexture.TextureFromFile(file, width, height);
        }
Exemple #5
0
 /// <summary>
 /// Construtor
 /// </summary>
 /// <param name="width"></param>
 /// <param name="height"></param>
 public EngineExperienceBar(string name, int width, int height)
 {
     Name         = string.Empty;
     Size         = new Size2(width, height);
     SourceRect   = new Rectangle(0, 0, width, height);
     Transparency = 255;
     Position     = new Point(0, 0);
     Color        = Color.White;
     Visible      = true;
     Enabled      = true;
     DrawText     = true;
     SpriteFlags  = SpriteFlags.AlphaBlend;
     textureBack  = EngineTexture.TextureFromFile($"{Common.Configuration.GamePath}/Data/Graphics/{name}_back.png", width, height);
     textureColor = EngineTexture.TextureFromFile($"{Common.Configuration.GamePath}/Data/Graphics/{name}_color.png", width, height);
     Texture      = EngineTexture.TextureFromFile($"{Common.Configuration.GamePath}/Data/Graphics/{name}_border.png", width, height);
 }
        /// <summary>
        /// Carrega um novo arquivo e obtém automaticamente o tamanho.
        /// </summary>
        /// <param name="file">Arquivo</param>
        public EngineObject(string file)
        {
            Name         = string.Empty;
            Transparency = 255;
            Visible      = true;
            Enabled      = true;
            DrawTexture  = true;
            Position     = new Point();
            Color        = Color.White;
            SpriteFlags  = SpriteFlags.AlphaBlend;

            Size2 size;

            Texture = EngineTexture.TextureFromFile(file, out size);

            Size       = size;
            SourceRect = new Rectangle(0, 0, Size.Width, Size.Height);
        }
        public EngineExpBar(int width, int height)
        {
            Name         = string.Empty;
            Size         = new Size2(width, height);
            SourceRect   = new Rectangle(0, 0, width, height);
            Transparency = 255;
            Position     = new Point(0, 0);
            Color        = Color.White;
            Visible      = true;
            Enabled      = true;
            DrawTexture  = true;
            DrawText     = true;
            SpriteFlags  = SpriteFlags.AlphaBlend;

            textureBack  = EngineTexture.TextureFromFile(Settings.GamePath + @"\Data\Graphics\bar_back.png", width, height);
            textureColor = EngineTexture.TextureFromFile(Settings.GamePath + @"\Data\Graphics\bar_color.png", width, height);
            Texture      = EngineTexture.TextureFromFile(Settings.GamePath + @"\Data\Graphics\bar_border.png", width, height);
        }
        /// <summary>
        /// Carrega um novo arquivo e obtém automaticamente o tamanho.
        /// </summary>
        /// <param name="lang">Idioma</param>
        /// <param name="file">Arquivo</param>
        /// <param name="name">Nome de Botão</param>
        public EngineButton(Language lang, string file, string name)
        {
            BorderRect   = new Rectangle();
            Position     = new Point();
            Enabled      = true;
            Visible      = true;
            Name         = string.Empty;
            Color        = Color.White;
            SpriteFlags  = SpriteFlags.AlphaBlend;
            Transparency = 255;
            Size2 size;

            string lang_path = "English";

            switch (lang)
            {
            case Language.Japanese:
                lang_path = "Japanese";
                break;

            case Language.English:
                lang_path = "English";
                break;

            case Language.Portuguese:
                lang_path = "Portuguese";
                break;

            case Language.Spanish:
                lang_path = "Spanish";
                break;

            case Language.Korean:
                lang_path = "Korean";
                break;
            }

            Texture[0] = EngineTexture.TextureFromFile(file + @"\Data\Graphics\" + lang_path + @"\" + name + "_inactive.png", out size);
            Texture[1] = EngineTexture.TextureFromFile(file + @"\Data\Graphics\" + lang_path + @"\" + name + "_hover.png", out size);
            Texture[2] = EngineTexture.TextureFromFile(file + @"\Data\Graphics\" + lang_path + @"\" + name + "_active.png", out size);

            Size       = size;
            SourceRect = new Rectangle(0, 0, Size.Width, Size.Height);
        }
Exemple #9
0
        /// <summary>
        /// Inicializa a caixa de mensagem carregando as texturas.
        /// </summary>
        public static void Initialize()
        {
            Visible      = false;
            Text         = string.Empty;
            Transparency = 255;
            Position     = new Point(272, 15);
            Enabled      = true;

            background            = new EngineObject();
            background.Texture    = EngineTexture.TextureFromFile(Common.Configuration.GamePath + @"\Data\Graphics\msgbox.png", 480, 128);
            background.Enabled    = false;
            background.Size       = new Size2(480, 128);
            background.SourceRect = new Rectangle(0, 0, 480, 120);
            background.Position   = Position;
            background.Visible    = true;

            button            = new EngineButton("ok", 128, 32);
            button.Position   = new Point(Position.X + 173, Position.Y + 55);
            button.Size       = new Size2(128, 32);
            button.BorderRect = new Rectangle(20, 2, 86, 26);
            button.SourceRect = new Rectangle(0, 0, 128, 32);
            button.MouseUp   += Button_MouseUp;
        }
        static EngineButton[] button = new EngineButton[2]; // 2 botões

        public static void Initialize()
        {
            Position         = new Point(295, 15);
            Visible          = false;
            TextTransparency = 255;

            background            = new EngineObject();
            background.Texture    = EngineTexture.TextureFromFile($"{Common.Configuration.GamePath}/Data/Graphics/inputbox.png", 424, 163);
            background.Size       = new Size2(424, 163);
            background.Position   = Position;
            background.SourceRect = new Rectangle(0, 0, 424, 163);
            background.Visible    = true;

            TextBox                  = new EngineTextBox("textbox", 256, 32);
            TextBox.Size             = new Size2(256, 32);
            TextBox.Position         = new Point(Position.X + 90, Position.Y + 50);
            TextBox.SourceRect       = new Rectangle(0, 0, 256, 32);
            TextBox.CursorEnabled    = true;
            TextBox.TextTransparency = 255;
            TextBox.MouseUp         += Textbox_MouseUp;
            TextBox.TextFormat       = FontDrawFlags.Center;

            button[0]            = new EngineButton("ok", 128, 32);
            button[0].Position   = new Point(Position.X + 90, Position.Y + 85);
            button[0].Size       = new Size2(128, 32);
            button[0].SourceRect = new Rectangle(0, 0, 128, 32);
            button[0].BorderRect = new Rectangle(20, 2, 86, 26);
            button[0].MouseUp   += Button_1_MouseUp;

            button[1]            = new EngineButton("cancel", 128, 32);
            button[1].Position   = new Point(Position.X + 205, Position.Y + 85);
            button[1].Size       = new Size2(128, 32);
            button[1].SourceRect = new Rectangle(0, 0, 128, 32);
            button[1].BorderRect = new Rectangle(20, 2, 86, 26);
            button[1].MouseUp   += Button_2_MouseUp;
        }
        /// <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(EngineTexture.FindTextureByID(Sprite, EngineTextureType.Sprites), 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(Name, new Size2(30, 0), new Point(X, Y - 5), Color.White, EngineFontStyle.Regular, FontDrawFlags.Center);
            EngineFont.DrawText(Guild, new Size2(30, 0), new Point(X, Y - 20), Color.BlueViolet, EngineFontStyle.Bold, FontDrawFlags.Center);
        }
Exemple #12
0
 public EngineSkillShortCut(int width, int height)
 {
     Texture = EngineTexture.TextureFromFile(Settings.GamePath + @"\Data\Graphics\slot.png", width, height);
 }