Ejemplo n.º 1
0
 public void show()
 {
     for (int i = 0; i < WN.Count; i++)
     {
         WN[i].show();
     }
     if (mMP != null)
     {
         mMP.Show();
     }
 }
Ejemplo n.º 2
0
 public override void Show()
 {
     if (!editorPanel.IsVisible)
     {
         editorPanel.Show();
     }
 }
Ejemplo n.º 3
0
        public OverlayContainer createStaticImage(Vector4 posAndSize, String imageName, bool topLevel)
        {
            mGUI.tc++;
            MaterialPtr ptr = Wof.Misc.ViewHelper.CloneMaterial("bgui.image", "bgui.image_" + imageName + mO.Name + StringConverter.ToString(mGUI.tc));

            ptr.GetBestTechnique().GetPass(0).GetTextureUnitState(0).SetTextureName(imageName);

            //  alpha_op_ex source1 src_manual src_texture 0.5
            // ptr.GetBestTechnique().GetPass(0).GetTextureUnitState(0).SetAlphaOperation(LayerBlendOperationEx.LBX_SOURCE1, LayerBlendSource.LBS_MANUAL, LayerBlendSource.LBS_TEXTURE, 0.5f);


            Overlay o;

            if (topLevel)
            {
                o = mGUI.mOTop;
            }
            else
            {
                o = mGUI.mO;
            }

            OverlayContainer x = mGUI.createOverlay(mO.Name + StringConverter.ToString(mGUI.tc) + imageName,
                                                    new Vector2(posAndSize.x, posAndSize.y), new Vector2(posAndSize.z, posAndSize.w), ptr.Name, "", false, o);

            ptr = null;

            mO.AddChild(x);
            x.Show();
            mI.Add(x);

            return(x);
        }
Ejemplo n.º 4
0
        public Button(Vector4 D, String M, String T, Callback C, Window P, Window window)
        {
            this.window = window;
            text        = T;

            x   = D.x;
            y   = D.y;
            w   = D.z;
            h   = D.w;
            mmn = M;
            mma = M;

            ResourcePtr ma = MaterialManager.Singleton.GetByName(mmn + ".active");

            if (ma != null)
            {
                mma += ".active";
            }
            ma = null;

            mO = P.mGUI.createOverlay(P.mO.Name + "b" +
                                      StringConverter.ToString(P.mGUI.bc++),
                                      new Vector2(x, y), new Vector2(w, h), M, "", false);

            mCP = P.mGUI.createOverlay(mO.Name + "c",
                                       new Vector2(GUI.OVERLAY_TITLE_MARGIN, (h - P.mGUI.mFontSize) / 2),
                                       new Vector2(w, h), "", T, false);

            P.mO.AddChild(mO);
            mO.Show();
            mO.AddChild(mCP);
            mCP.Show();
            callback = C;
        }
Ejemplo n.º 5
0
        public void Update(int time)
        {
            ModelEffectsManager.Instance.UpdateEffect(time, EffectType.BulletTimeEffect);
            float width = ModelEffectsManager.Instance.GetEffectLevel(EffectType.BulletTimeEffect) * _width;

            //_barOverConta.SetPosition(_startPoint.X, _startPoint.Y - (_heigth - h));


            _barOverConta.SetDimensions(width, _height);
            _barOverConta.Show();

            // todo: timer
            if (width < _width * _threshold)
            {
                thresholdCrossed = true;
                if (blinkDelay.Milliseconds > 100)
                {
                    BetaGUI.Window.ChangeContainerColour(_text, _colour2);
                    if (_text.IsVisible)
                    {
                        _text.Hide();
                    }
                    else
                    {
                        _text.Show();
                    }
                    blinkDelay.Reset();
                }
            }
            else
            {
                if (thresholdCrossed)
                {
                    blinkDelay.Reset();
                    BetaGUI.Window.ChangeContainerColour(_text, _colour1);
                    if (!_text.IsVisible)
                    {
                        _text.Show();
                    }
                    thresholdCrossed = false;
                }
            }
        }
Ejemplo n.º 6
0
        public OverlayContainer createOverlay(String N, Vector2 P, Vector2 D,
                                              String M, String C, bool A, Overlay target)
        {
            String t = "Panel";

            if (C != "")
            {
                t = "TextArea";
            }
            OverlayElement e = OverlayManager.Singleton.CreateOverlayElement(t, N + this.name + DateTime.Now.Ticks);

            e.MetricsMode = GuiMetricsMode.GMM_PIXELS;
            e.SetDimensions(D.x, D.y);
            e.SetPosition(0, 0);


            //if (M != "")
            //    e.MaterialName = M;

            if (C != "")
            {
                if (A)
                {
                    e.Top  = OVERLAY_TITLE_MARGIN;
                    e.Left = OVERLAY_TITLE_MARGIN;
                }

                e.Caption = C;
                e.SetParameter("font_name", mFont);
                e.SetParameter("char_height", StringConverter.ToString(mFontSize));
            }


            OverlayContainer c =
                (OverlayContainer)
                OverlayManager.Singleton.CreateOverlayElement("Panel", name + "ContainerHack" + (oc++).ToString());

            c.MetricsMode = GuiMetricsMode.GMM_PIXELS;
            c.SetDimensions(D.x, D.y);
            c.SetPosition(P.x, P.y);

            if (M != "")
            {
                c.MaterialName = M;
            }
            c.AddChild(e);
            if (A)
            {
                target.Add2D(c);
                c.Show();
            }
            return(c);
        }
Ejemplo n.º 7
0
        private void ConfigureContainer(OverlayContainer container, OverlayElement element, int width, int height,
                                        int posX, int posY)
        {
            container.MetricsMode = GuiMetricsMode.GMM_PIXELS;
            container.SetDimensions(minimapViewport.ActualWidth, minimapViewport.ActualHeight);
            container.SetPosition(posX,
                                  posY);

            container.AddChild(element);
            hudOverlay.Add2D(container);
            container.Show();
        }
Ejemplo n.º 8
0
        // zmiana zwracanego typu z void na OverlayContainer by Adam
        public OverlayContainer createStaticText(Vector4 D, String T, ColourValue cTop, ColourValue cBottom)
        {
            OverlayContainer x = mGUI.createOverlay(mO.Name +
                                                    StringConverter.ToString(mGUI.tc++),
                                                    new Vector2(D.x, D.y), new Vector2(D.z, D.w), "", T, false);



            ChangeContainerColour(x, cTop, cBottom);

            mO.AddChild(x);
            x.Show();

            return(x);
        }
Ejemplo n.º 9
0
        private void CreateMessageContainer()
        {
            // BetaGUI.GUI gui = new GUI();
            // Window w = gui.createWindow();
            // w.createStaticImage()

            backgroundElement.Hide();
            iconOverlay             = OverlayManager.Singleton.GetByName("Wof/MessageBar");
            iconElement             = OverlayManager.Singleton.GetOverlayElement("Wof/MessageBarIcon");
            iconElement.MetricsMode = GuiMetricsMode.GMM_RELATIVE;
            iconElement.SetDimensions(radioIconWidth, radioIconWidth);
            iconElement.Show();
            iconOverlay.Hide();     // zewnetrzny kontener ukryje wszystko


            iconDefaultDimesions.x = Mogre.StringConverter.ParseReal(iconElement.GetParameter("width"));
            iconDefaultDimesions.y = Mogre.StringConverter.ParseReal(iconElement.GetParameter("height"));

            messageElement = OverlayManager.Singleton.CreateOverlayElement(
                "TextArea", "messageElement " + DateTime.Now.Ticks);
            messageContainer = (OverlayContainer)OverlayManager.Singleton.CreateOverlayElement(
                "Panel", "messageContainer " + DateTime.Now.Ticks);

            messageElement.SetDimensions(mainViewport.ActualWidth, mainViewport.ActualHeight);
            messageElement.MetricsMode = GuiMetricsMode.GMM_PIXELS;

            messageElement.SetParameter("font_name", FontManager.CurrentFont);

            messageElement.MetricsMode = GuiMetricsMode.GMM_RELATIVE;
            messageElement.SetParameter("char_height", StringConverter.ToString(EngineConfig.CurrentFontSize));
            messageElement.SetParameter("colour_top", "0.1 0.1 0.1");
            messageElement.SetParameter("colour_bottom", "0.5 0.1 0.1");
            messageElement.Caption = "";


            messageContainer.MetricsMode = GuiMetricsMode.GMM_RELATIVE;
            messageContainer.SetDimensions(1.0f, 0.05f);
            // messageContainer.SetPosition(0.055f, 0.015f);

            messageContainer.AddChild(messageElement);
            messageOverlay.Add2D(messageContainer);
            messageContainer.Show();
        }
Ejemplo n.º 10
0
        /** Constructor
         *  @param
         *      name The name to be given to the widget (must be unique).
         *  @note
         *      If you want a transparent background, pass "" as the material.
         */
        public Sheet(string name, string material)
            : base(name, new Vector4(0, 0, 1, 1), QGuiMetricsMode.QGUI_GMM_RELATIVE, QGuiMetricsMode.QGUI_GMM_RELATIVE, material, null, null)
        {
            mDefaultCharacterHeight = 1;
            mDefaultTextColor       = ColourValue.White;
            mDefaultSkin            = "qgui";
            mAutoNameWindowCounter  = 0;
            mMenuOverlayZOrder      = 600;

            mVerticalAlignment = GuiVerticalAlignment.GVA_BOTTOM;

            mWidgetType = Widget.WidgetType.QGUI_TYPE_SHEET;
            mWindows.Clear();
            // Sheets are always at zOrder 0.
            mOverlay        = OverlayManager.Singleton.Create(mInstanceName + ".Overlay");
            mOverlay.ZOrder = 0;
            mOverlay.Show();
            mOverlay.Add2D(mOverlayContainer);

            FontManager fm = FontManager.Singleton;

            ResourceManager.ResourceMapIterator rmi = fm.GetResourceIterator();
            if (rmi.MoveNext())
            {
                mDefaultFont = rmi.Current.Name;
            }
            else
            {
                mDefaultFont = string.Empty;
            }

            // Create menu overlay and container
            mMenuOverlay = OverlayManager.Singleton.Create(mInstanceName + ".MenuOverlay");
            mMenuOverlay.Show();
            mMenuContainer = createOverlayContainer(mInstanceName + ".MenuContainer", "");
            mMenuOverlay.Add2D(mMenuContainer);
            mMenuContainer.Show();

            // Set zOrder very high, but leave room for containers and mouse cursor to show up correctly.
            mMenuOverlay.ZOrder = (ushort)mMenuOverlayZOrder;
        }
Ejemplo n.º 11
0
        } // mCP here if ...

        public TextInput(Vector4 D, String M, String V, uint L, Window P)
        {
            x      = D.x;
            y      = D.y;
            w      = D.z;
            h      = D.w;
            value  = V;
            mmn    = M;
            mme    = M;
            mma    = M;
            length = L;

            ResourcePtr ma = MaterialManager.Singleton.GetByName(mmn + ".active");

            if (ma != null)
            {
                mma += ".active";
            }
            ma = null;

            ma = MaterialManager.Singleton.GetByName(mmn + ".active.error");
            if (ma != null)
            {
                mme += ".active.error";
            }
            ma = null;

            mO = P.mGUI.createOverlay(P.mO.Name + "t" +
                                      StringConverter.ToString(P.mGUI.tc++),
                                      new Vector2(x, y), new Vector2(w, h), M, "", false);
            mCP = P.mGUI.createOverlay(mO.Name + "c",
                                       new Vector2(0, (h - P.mGUI.mFontSize) / 2),
                                       new Vector2(w, h), "", V, false);
            P.mO.AddChild(mO);
            mO.Show();
            mO.AddChild(mCP);
            mCP.Show();
        }
Ejemplo n.º 12
0
        public Window(string name, Vector4 dimensions, QGuiMetricsMode positionMode, QGuiMetricsMode sizeMode, string material, Widget parentWidget) : base(name, dimensions, positionMode, sizeMode, material, null, parentWidget)
        {
            mTitleBar       = null;
            mTitleBarHidden = false;


            mWidgetType     = Widget.WidgetType.QGUI_TYPE_WINDOW;
            mOverlay        = OverlayManager.Singleton.Create(mInstanceName + ".Overlay");
            mOverlay.ZOrder = 0;
            mOverlay.Show();
            mZOrderValues.Add(0);

            // mChildrenContainer already created in Widget constructor
            mTitleBarContainer = createOverlayContainer(mInstanceName + ".TitleBarContainer", "");

            mOverlay.Add2D(mOverlayContainer);
            mChildrenContainer.AddChildImpl(mTitleBarContainer);

            mOverlayContainer.Show();
            mChildrenContainer.Show();
            mTitleBarContainer.Show();

            // Create TitleBar - tradition titlebar dimensions: across the top of the window
            Vector4 defaultTitleBarDimensions = new Vector4(0f, 0f, 1f, 0.05f / getSize(QGuiMetricsMode.QGUI_GMM_ABSOLUTE).y);

            mTitleBar = new TitleBar(mInstanceName + ".Titlebar", defaultTitleBarDimensions, QGuiMetricsMode.QGUI_GMM_RELATIVE, QGuiMetricsMode.QGUI_GMM_RELATIVE, mWidgetMaterial + ".titlebar", mTitleBarContainer, this);
            mTitleBar.enableDragging(true);
            mTitleBar.setDraggingWidget(this);
            mTitleBar.getTextWidget().enableDragging(true);
            mTitleBar.getTextWidget().setDraggingWidget(this);
            mTitleBar.setZOrderOffset(1);
            _addChildWidget(mTitleBar);

            // Now that mOverlayContainer has been created (via _init() function) we can create the borders
            _createBorders();

            OnActivate += new ActivateEventHandler(Window_OnActivate);
        }
Ejemplo n.º 13
0
        internal MouseCursor(Vector2 dimensions, string material, int RenderWidthInPixels, int RenderHeightInPixels)
        {
            instance  = this;
            mMaterial = material;
            mRelativeCursorDimensions = dimensions;
            mRenderWidthInPixels      = RenderWidthInPixels;
            mRenderHeightInPixels     = RenderHeightInPixels;
            mVisible           = true;
            mHideWhenOffScreen = true;
            mOnTopBorder       = false;
            mOnBotBorder       = false;
            mOnLeftBorder      = false;
            mOnRightBorder     = false;

            mPixelCursorDimensions.x = mRelativeCursorDimensions.x; // *RenderWidthInPixels; // GDZ: Prefiero al cursor en pixels
            mPixelCursorDimensions.y = mRelativeCursorDimensions.y; // *RenderHeightInPixels; // GDZ: Prefiero al cursor en pixels
            mConstraints.x           = RenderWidthInPixels;
            mConstraints.y           = RenderHeightInPixels;
            mPosition.x = mConstraints.x / 2;
            mPosition.y = mConstraints.y / 2;

            // Create Mouse Overlay
            mMouseOverlay        = OverlayManager.Singleton.Create("simpleGUI_Mouse_Overlay");
            mMouseOverlay.ZOrder = 649;
            mMouseOverlay.Show();

            // Create Mouse Overlay Container
            mMousePointerContainer             = (OverlayContainer)(OverlayManager.Singleton.CreateOverlayElement("Panel", "simpleGUI_Mouse_Container"));
            mMousePointerContainer.MetricsMode = GuiMetricsMode.GMM_PIXELS;
            mMousePointerContainer.SetPosition(mPosition.x, mPosition.y);
            mMousePointerContainer.SetDimensions(Mogre.Math.Ceil(mPixelCursorDimensions.x), Mogre.Math.Ceil(mPixelCursorDimensions.y));
            mMousePointerContainer.MaterialName = mMaterial;

            mMouseOverlay.Add2D(mMousePointerContainer);
            mMousePointerContainer.Show();
        }
Ejemplo n.º 14
0
 public void show()
 {
     mO.Show();
 }