Example #1
0
        /// <summary>
        /// Construtor.
        /// </summary>
        public EngineChat()
        {
            Message = new List <EngineChatText>();

            Position     = new Point(5, 435);
            Texture      = EngineTexture.TextureFromFile($"./Data/Graphics/window_chat.png");
            Size         = new Size2(277, 203);
            SourceRect   = new Rectangle(0, 0, 277, 203);
            BorderRect   = new Rectangle(0, 0, 277, 203);
            Transparency = 255;

            scroll_background              = new EngineObject();
            scroll_background.Position     = new Point(Position.X + 255, Position.Y + 10);
            scroll_background.Size         = new Size2(10, 172);
            scroll_background.Texture      = EngineTexture.TextureFromFile($"./Data/Graphics/scroll_background.png");
            scroll_background.SourceRect   = new Rectangle(0, 0, 10, 172);
            scroll_background.Transparency = 255;

            button[0]            = new EngineButton("arrow_up", 10, 10);
            button[0].Name       = "up";
            button[0].Position   = new Point(Position.X + 255, Position.Y + 10);
            button[0].BorderRect = new Rectangle(0, 0, 10, 10);
            button[0].SourceRect = new Rectangle(0, 0, 10, 10);
            button[0].Size       = new Size2(10, 10);
            button[0].MouseUp   += Up_Click;

            button[1]            = new EngineButton("arrow_down", 10, 10);
            button[1].Name       = "down";
            button[1].Position   = new Point(Position.X + 255, Position.Y + 145);
            button[1].BorderRect = new Rectangle(0, 0, 10, 10);
            button[1].SourceRect = new Rectangle(0, 0, 10, 10);
            button[1].Size       = new Size2(10, 10);
            button[1].MouseUp   += Down_Click;
        }
Example #2
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;
        }