示例#1
0
        public HvrRender()
        {
            renderInterface = new RenderInterface();

            viewportSettings.height = 600;
            viewportSettings.width  = 400;
        }
示例#2
0
        public GuiService()
        {
            _graphics = ServiceLocator.Instance.GetService<GraphicsDevice>();
            _timer = ServiceLocator.Instance.GetService<ITimerService>();
            _keyboard = ServiceLocator.Instance.GetService<IKeyboardService>();
            _mouse = ServiceLocator.Instance.GetService<IMouseService>();
            _renderInterface = new Gui.LibRocketRenderInterface(_graphics, ServiceLocator.Instance.GetService<ContentManager>(), true);
            _coroutines = ServiceLocator.Instance.GetService<ICoroutineService>();

            LibRocketNet.Core.SystemInterface = new Gui.LibRocketSystemInterface(_timer);
            LibRocketNet.Core.RenderInterface = _renderInterface;
            LibRocketNet.Core.Initialize();
            LibRocketNet.Core.ScriptEvent += (o, e) =>
            {
                Console.WriteLine("[Gui] Script event:" + e.Script);
            };

            Context = LibRocketNet.Core.CreateContext(
                ContextName,
                new Vector2i(_graphics.Viewport.Width, _graphics.Viewport.Height));

            LoadFonts();
            LibRocketNet.Core.InitDebugger(Context);

            _keyboard.KeyDown += KeyDownHandler;
            _keyboard.KeyUp += KeyUpHandler;
            _mouse.ButtonDown += (o, e) => {
                Context.ProcessMouseButtonDown(e, GetKeyModifiers());
            };
            _mouse.ButtonUp +=
                (o, e) => Context.ProcessMouseButtonUp(e, GetKeyModifiers());

            _mouse.WheelChanged += (w) =>
            {
                Context.ProcessMouseWheel(-w, GetKeyModifiers());
            };
            _mouse.Move += ProcessMouseMove;

            _coroutines.StartCoroutine(UpdateUI());
        }
示例#3
0
 public void Render(RenderInterface ri)
 {
     Console.WriteLine(@"Rendering RenderInterface");
 }
示例#4
0
 public Editor(Project project, RenderInterface renderer)
 {
     Renderer = renderer;
     OpenProject(project);
 }