Пример #1
0
        public Renderable(GraphicsDevice device, GuiDriver module, int width, int height, Euler Euler = null)
        {
            this.module      = module;
            this.Orientation = Euler;
            if (this.Orientation == null)
            {
                this.Orientation = new Euler();
            }

            uiCamera        = new Render.Cameras.OrthographicCamera(new Viewport(0, 0, width, height));
            uiRoot          = new UIItem(new Rectangle(0, 0, width, height));
            uiRoot.settings = new PropertySet();

            uiCamera.focus = new Vector2(width / 2, height / 2);

            renderTarget = new RenderTarget2D(device, uiCamera.Viewport.Width, uiCamera.Viewport.Height);
            var rawGuiQuad = Geo.Gen.CreateQuad();

            rawGuiQuad      = Geo.Gen.FacetCopy(rawGuiQuad);
            quadModel       = Geo.CompiledModel.CompileModel(rawGuiQuad, device);
            uiRoot.defaults = module.defaultSettings;
        }
Пример #2
-1
        public Renderable(GraphicsDevice device, GuiDriver module, int width, int height, Euler Euler = null)
        {
            this.module = module;
            this.Orientation = Euler;
            if (this.Orientation == null) this.Orientation = new Euler();

            uiCamera = new Render.Cameras.OrthographicCamera(new Viewport(0, 0, width, height));
            uiRoot = new UIItem(new Rectangle(0, 0, width, height));
            uiRoot.settings = new PropertySet();

            uiCamera.focus = new Vector2(width / 2, height / 2);

            renderTarget = new RenderTarget2D(device, uiCamera.Viewport.Width, uiCamera.Viewport.Height);
            var rawGuiQuad = Geo.Gen.CreateQuad();
            rawGuiQuad = Geo.Gen.FacetCopy(rawGuiQuad);
            quadModel = Geo.CompiledModel.CompileModel(rawGuiQuad, device);
            uiRoot.defaults = module.defaultSettings;
        }