EditorUiNode.h 872 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <AnKi/Scene/SceneNode.h>
  6. #include <AnKi/Scene/Components/UiComponent.h>
  7. #include <AnKi/Editor/EditorUi.h>
  8. namespace anki {
  9. // Contains the Editor UI. If the UI is visible then it steals the input so otheres need to disable input handling.
  10. class EditorUiNode : public SceneNode
  11. {
  12. public:
  13. EditorUi m_editorUi;
  14. EditorUiNode(CString name)
  15. : SceneNode(name)
  16. {
  17. UiComponent* uic = newComponent<UiComponent>();
  18. uic->init(
  19. [](UiCanvas& canvas, void* ud) {
  20. static_cast<EditorUiNode*>(ud)->m_editorUi.draw(canvas);
  21. },
  22. this);
  23. }
  24. private:
  25. void frameUpdate([[maybe_unused]] Second prevUpdateTime, [[maybe_unused]] Second crntTime) override;
  26. };
  27. } // end namespace anki