BsScriptGUI.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 bs
  7. {
  8. /** @addtogroup ScriptInteropEngine
  9. * @{
  10. */
  11. /** Interop class between C++ & CLR for a global always-accessible GUIWidget. */
  12. class BS_SCR_BE_EXPORT ScriptGUI : public ScriptObject <ScriptGUI>
  13. {
  14. public:
  15. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUI")
  16. /** Creates the globally accessible GUIWidget and makes the system ready to use. */
  17. static void startUp();
  18. /** Updates the main camera the widget renders to, if it changes. Should be called every frame. */
  19. static void update();
  20. /** Destroys the globally accessible GUIWidget and all its GUI elements. */
  21. static void shutDown();
  22. private:
  23. ScriptGUI(MonoObject* managedInstance);
  24. ~ScriptGUI();
  25. static SPtr<GUIWidget> sGUIWidget;
  26. static ScriptGUILayout* sPanel;
  27. static MonoMethod* sGUIPanelMethod;
  28. static HEvent sDomainUnloadConn;
  29. static HEvent sDomainLoadConn;
  30. /************************************************************************/
  31. /* CLR HOOKS */
  32. /************************************************************************/
  33. static void internal_SetSkin(ScriptGUISkin* skin);
  34. };
  35. /** @} */
  36. }