コード例 #1
0
        private void DrawUi(GameTime gameTime)
        {
            _imguiRenderer.BeforeLayout(gameTime);

            // Draw viewport overlays
            if (!string.IsNullOrEmpty(hoveredentityId))
            {
                DrawSpriteBounds(hoveredentityId, Color.CornflowerBlue.PackedValue);
            }
            else if (!string.IsNullOrEmpty(selectedEntityId))
            {
                DrawSpriteBounds(selectedEntityId, Color.GreenYellow.PackedValue);
            }

            ImGui.Begin("timeline");
            ImGuiEx.DrawUiTimeline(_state.Animator);
            ImGui.End();

            var hierarchyWindowWidth = 256;

            ImGui.SetNextWindowPos(new NVector2(GraphicsDevice.Viewport.Width - hierarchyWindowWidth, 0), ImGuiCond.FirstUseEver);
            ImGui.SetNextWindowSize(NVector2.UnitX * hierarchyWindowWidth +
                                    NVector2.UnitY * GraphicsDevice.Viewport.Height, ImGuiCond.FirstUseEver);

            ImGui.Begin("Management");
            {
                DrawUiActions();
                DrawUiHierarchyFrame();
                DrawUiProperties();
            }
            ImGui.End();

            _imguiRenderer.AfterLayout();

            if (ImGui.IsWindowHovered(ImGuiHoveredFlags.AnyWindow))
            {
                ImGui.CaptureKeyboardFromApp();
                ImGui.CaptureMouseFromApp();
            }
        }