BsScriptGUI.h 1.2 KB

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