Ejemplo n.º 1
0
        public override void Init()
        {
            this.Material = Resource.GetMaterial("engine/depth");
            this.drawMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
            this.Model = Resource.GetMesh("engine/quad.obj");

            DepthScreen = GUIManager.Create<Panel>();
            DepthScreen.SetMaterial(Resource.GetMaterial("engine/depth"));
            DepthScreen.SetWidth(Utilities.engine.Width / Size);
            DepthScreen.SetHeight(Utilities.engine.Height / Size);
            DepthScreen.SetPos(new Vector2(0, Utilities.engine.Height - DepthScreen.Height));
            DepthScreen.AlphaBlendmode = false;

            Utilities.engine.Keyboard.KeyDown += new EventHandler<OpenTK.Input.KeyboardKeyEventArgs>(Keyboard_KeyDown);
        }
Ejemplo n.º 2
0
        public override void Init()
        {
            this.Position = new Vector2(200, 480);
            this.WindowTitle = "Untitled";
            this.Width = 200;
            this.Height = 150;
            this.SetMaterial(Resource.GetTexture("gui/window.png"));
            this.SetColor(20, 24, 33);

            //Create the grabbable title section of the window
            Title = GUIManager.Create<Panel>( this.Parent );
            Title.SetMaterial(Resource.GetTexture("gui/title.png"));
            Title.SetWidthHeight(this.Width, 25);
            Title.SetPos(this.Position - new Vector2(0, Title.Height));
            Title.OnMouseDown += new Action<Panel,OpenTK.Input.MouseButtonEventArgs>(Title_OnMouseDown);
            Title.OnMouseMove += new Action<Panel,OpenTK.Input.MouseMoveEventArgs>(Title_OnMouseMove);
            Title.OnMouseUp += new Action<Panel,OpenTK.Input.MouseButtonEventArgs>(Title_OnMouseUp);
            Title.SetColor(135, 36, 31);

            //Create the text that is overlayed upon the title section
            TitleText = GUIManager.Create<Label>(Title);
            TitleText.SetFont("defaultTitle");
            TitleText.SetPos(0, 0);
            TitleText.SetWidthHeight(this.Width, Title.Height);
            TitleText.SetColor(255, 255, 255);
            TitleText.SetText(this.WindowTitle);
            TitleText.Dock(DockStyle.LEFT);
            TitleText.SetAlignment(Label.TextAlign.MiddleLeft);
            TitleText.DockPadding(10, 10, 0, 0);

            //Create the close button
            closeButton = GUIManager.Create<Button>(Title);
            closeButton.SetImage(Resource.GetTexture("gui/close.png"));
            closeButton.SetWidthHeight(25, 25);
            closeButton.SetColor(26, 30, 38);
            closeButton.Dock(DockStyle.RIGHT);
            closeButton.AlignRight();
            closeButton.OnButtonPress += new Button.OnButtonPressDel(closeButton_OnButtonPress);
            closeButton.PreDraw += new Action<Panel, Vector2, DrawEventArgs>(closeButton_PreDraw);
        }
Ejemplo n.º 3
0
        public override void Init()
        {
            base.Init();

            contextPanel = GUIManager.Create<Panel>();
            contextPanel.ShouldPassInput = true;
            contextPanel.SetWidth(150);
            contextPanel.SetPos(this.Position.X, this.Position.Y + this.Height);

            //Create our text label
            TextLabel = GUIManager.Create<Label>();
            TextLabel.SetParent(this);
            TextLabel.Autosize = false;
            TextLabel.Dock(DockStyle.FILL);
            TextLabel.SetAlignment(Label.TextAlign.MiddleCenter);

            this.SetButtonState(State.Idle);

            Utilities.engine.Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Mouse_ButtonDown);
        }