Ejemplo n.º 1
0
        public static void DrawUI()
        {
            /* Turn display */
            turnDisplay = new BoxUIElement(GameManager.game);
            turnDisplay.Resize(300, 50);
            turnDisplay.SetPosition(Vector2.Zero);
            turnDisplay.BackgroundColor = Color.LightSlateGray;

            turnDisplayText = new TextUIElement(GameManager.game, FontManager.B15(GameManager.game), turnDisplay);
            turnDisplayText.AlignWithParent();

            /* Unit info */
            unitInfo = new BoxUIElement(GameManager.game);
            unitInfo.Resize(150, 200);
            unitInfo.SetPosition(new Vector2(
                                     0,
                                     VideoSettings.GetResolution().Y - unitInfo.height));
            unitInfo.BackgroundColor = Color.LightSlateGray;

            unitInfoHeader = new TextUIElement(GameManager.game, FontManager.B15(GameManager.game), unitInfo);
            unitInfoHeader.AlignWithParent();
            unitInfoHeader.Text = "Current unit";
            unitInfoText        = new TextUIElement(GameManager.game, FontManager.B15(GameManager.game), unitInfo);
            unitInfoText.AlignWithParent();
            unitInfoText.ApplyOffset(new Vector2(0, 30));
        }
Ejemplo n.º 2
0
        private void main_ultraGrid_MouseDown(object sender, MouseEventArgs e)
        {
            this.main_ultraGrid.ContextMenuStrip = null;
            if (e.Button != MouseButtons.Right)
            {
                return;
            }

            Point     clickPoint = new Point(e.X, e.Y);
            UIElement el         = this.main_ultraGrid.DisplayLayout.UIElement.ElementFromPoint(clickPoint);

            if (el is TextUIElement == false)
            {
                return;
            }

            TextUIElement tue = (TextUIElement)el;

            if (el.Parent is HeaderUIElement)
            {
                this.main_ultraGrid.ContextMenuStrip = this.Get_ColRightClick_menu(tue.Text);
            }
        }