Ejemplo n.º 1
0
        public GuiSceneNode(Geo.Mesh Mesh, GraphicsDevice device, int width, int height, Euler Euler = null)
        {
            this.Device = device;
            this.Mesh = Mesh;

            this.Orientation = Euler;
            if (this.Orientation == null) this.Orientation = new Euler();

            uiCamera = new Render.OrthographicCamera(new Viewport(0, 0, width, height));
            uiRoot = new UIItem("ROOT", new QuadShape(0, 0, width, height), null);

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

            renderTarget = new RenderTarget2D(device, uiCamera.Viewport.Width, uiCamera.Viewport.Height);
        }
Ejemplo n.º 2
0
Archivo: Main.cs Proyecto: Blecki/CCDC
        protected override void LoadContent()
        {
            EpisodeContent = new EpisodeContentManager(Content.ServiceProvider, "");
            var mainConsole = AllocateConsole(GraphicsDevice.Viewport.Bounds);
            ScriptBuilder = new Gem.ScriptBuilder(mainConsole.WriteLine);
            mainConsole.ConsoleCommandHandler += s =>
            {
                var action = ScriptBuilder.CompileScript(s);
                if (action != null) action();
            };
            mainConsole.Resize(GraphicsDevice.Viewport.Bounds, 2);

            RenderContext = new Render.RenderContext(EpisodeContent.Load<Effect>("Content/draw"), GraphicsDevice);
            ConsoleCamera = new Render.OrthographicCamera(GraphicsDevice.Viewport);
            ConsoleCamera.focus = new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2);

            Input.PushKeyboardHandler(new MainKeyboardHandler(this));
        }