Esempio n. 1
0
        public GuiDriver(GraphicsDevice device, Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            this.device = device;
            uiRenderer = new Render.ImmediateMode2d(device);

            defaultSettings = new PropertySet(
                "bg-color", new Vector3(0, 1, 0),
                "text-color", new Vector3(1, 1, 1),
                "fg-color", new Vector3(1, 1, 1),
                "hidden-container", null,
                "font", new BitmapFont(Content.Load<Texture2D>("Content/small-font"), 6, 8, 6)
                );
        }
Esempio n. 2
0
        protected override void LoadContent()
        {
            var mainConsole = AllocateConsole(new Rectangle(0, 0, 800, 600));

            Immediate2d = new Gem.Render.ImmediateMode2d(GraphicsDevice);

            mainConsole.BindKeyboard(() => ConsoleOpen, Input);

            Input.textHook.KeyPress += (hook, args) =>
            {
                if (args.KeyChar == '~')
                {
                    ConsoleOpen = !ConsoleOpen;
                }
            };
        }
Esempio n. 3
0
        public Renderer(GraphicsDevice device, ContentManager content)
        {
            this.device = device;
            debug       = new ImmediateModeDebug(device);

            drawEffect = new BasicEffect(device);
            drawEffect.TextureEnabled     = true;
            drawEffect.VertexColorEnabled = false;

            drawSpriteEffect = new AlphaTestEffect(device);
            drawSpriteEffect.VertexColorEnabled = false;

            drawIDEffect = new BasicEffect(device);
            drawIDEffect.TextureEnabled     = false;
            drawIDEffect.VertexColorEnabled = false;

            Camera.Viewport = device.Viewport;

            mousePickTarget = new RenderTarget2D(device, 1, 1, false, SurfaceFormat.Color, DepthFormat.Depth24);

            immediate2d = new ImmediateMode2d(device);
        }
Esempio n. 4
0
        public Renderer(GraphicsDevice device, ContentManager content)
        {
            this.device = device;
            debug = new ImmediateModeDebug(device);

            drawEffect = new BasicEffect(device);
            drawEffect.TextureEnabled = true;
            drawEffect.VertexColorEnabled = false;

            drawSpriteEffect = new AlphaTestEffect(device);
            drawSpriteEffect.VertexColorEnabled = false;

            drawIDEffect = new BasicEffect(device);
            drawIDEffect.TextureEnabled = false;
            drawIDEffect.VertexColorEnabled = false;

            Camera.Viewport = device.Viewport;

            mousePickTarget = new RenderTarget2D(device, 1, 1, false, SurfaceFormat.Color, DepthFormat.Depth24);

            immediate2d = new ImmediateMode2d(device);
        }
Esempio n. 5
0
        protected override void LoadContent()
        {
            var mainConsole = AllocateConsole(new Rectangle(0, 0, 800, 600));
            Immediate2d = new Gem.Render.ImmediateMode2d(GraphicsDevice);

            mainConsole.BindKeyboard(() => ConsoleOpen, Input);

            Input.textHook.KeyPress += (hook, args) =>
                {
                    if (args.KeyChar == '~')
                        ConsoleOpen = !ConsoleOpen;
                };
        }