BsScriptGUI.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "BsScriptObject.h"
  6. namespace BansheeEngine
  7. {
  8. /** Interop class between C++ & CLR for a global always-accessible GUIWidget. */
  9. class BS_SCR_BE_EXPORT ScriptGUI : public ScriptObject <ScriptGUI>
  10. {
  11. public:
  12. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUI")
  13. /** Creates the globally accessible GUIWidget and makes the system ready to use. */
  14. static void startUp();
  15. /** Updates the main camera the widget renders to, if it changes. Should be called every frame. */
  16. static void update();
  17. /** Destroys the globally accessible GUIWidget and all its GUI elements. */
  18. static void shutDown();
  19. private:
  20. ScriptGUI(MonoObject* managedInstance);
  21. ~ScriptGUI();
  22. static SPtr<GUIWidget> sGUIWidget;
  23. static ScriptGUILayout* sPanel;
  24. static MonoMethod* sGUIPanelMethod;
  25. static HEvent sDomainUnloadConn;
  26. static HEvent sDomainLoadConn;
  27. /************************************************************************/
  28. /* CLR HOOKS */
  29. /************************************************************************/
  30. static void internal_SetSkin(ScriptGUISkin* skin);
  31. };
  32. }