SceneManager.lua 950 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. class "SceneManager"
  2. function SceneManager:SceneManager(...)
  3. for k,v in pairs(arg) do
  4. if type(v) == "table" then
  5. if v.__ptr ~= nil then
  6. arg[k] = v.__ptr
  7. end
  8. end
  9. end
  10. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  11. self.__ptr = Polycore.SceneManager(unpack(arg))
  12. Polycore.__ptr_lookup[self.__ptr] = self
  13. end
  14. end
  15. function SceneManager:addScene(newScene)
  16. local retVal = Polycore.SceneManager_addScene(self.__ptr, newScene.__ptr)
  17. end
  18. function SceneManager:Update()
  19. local retVal = Polycore.SceneManager_Update(self.__ptr)
  20. end
  21. function SceneManager:UpdateVirtual()
  22. local retVal = Polycore.SceneManager_UpdateVirtual(self.__ptr)
  23. end
  24. function SceneManager:removeScene(scene)
  25. local retVal = Polycore.SceneManager_removeScene(self.__ptr, scene.__ptr)
  26. end
  27. function SceneManager:registerRenderTexture(r_enderTexture)
  28. local retVal = Polycore.SceneManager_registerRenderTexture(self.__ptr, r_enderTexture.__ptr)
  29. end