SceneSound.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. require "Polycode/Entity"
  2. class "SceneSound" (Entity)
  3. function SceneSound:SceneSound(...)
  4. local arg = {...}
  5. if type(arg[1]) == "table" and count(arg) == 1 then
  6. if ""..arg[1].__classname == "Entity" then
  7. self.__ptr = arg[1].__ptr
  8. return
  9. end
  10. end
  11. for k,v in pairs(arg) do
  12. if type(v) == "table" then
  13. if v.__ptr ~= nil then
  14. arg[k] = v.__ptr
  15. end
  16. end
  17. end
  18. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  19. self.__ptr = Polycode.SceneSound(unpack(arg))
  20. end
  21. end
  22. function SceneSound:Update()
  23. local retVal = Polycode.SceneSound_Update(self.__ptr)
  24. end
  25. function SceneSound:isDirectionalSound()
  26. local retVal = Polycode.SceneSound_isDirectionalSound(self.__ptr)
  27. return retVal
  28. end
  29. function SceneSound:setDirectionalSound(val)
  30. local retVal = Polycode.SceneSound_setDirectionalSound(self.__ptr, val)
  31. end
  32. function SceneSound:setLoopOnLoad(val)
  33. local retVal = Polycode.SceneSound_setLoopOnLoad(self.__ptr, val)
  34. end
  35. function SceneSound:getLoopOnLoad()
  36. local retVal = Polycode.SceneSound_getLoopOnLoad(self.__ptr)
  37. return retVal
  38. end
  39. function SceneSound:__delete()
  40. if self then Polycode.delete_SceneSound(self.__ptr) end
  41. end