SceneEntity.lua 519 B

1234567891011121314151617181920212223242526272829
  1. require "Polycode/Entity"
  2. class "SceneEntity" (Entity)
  3. function SceneEntity:SceneEntity(...)
  4. for k,v in pairs(arg) do
  5. if type(v) == "table" then
  6. if v.__ptr ~= nil then
  7. arg[k] = v.__ptr
  8. end
  9. end
  10. end
  11. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  12. self.__ptr = Polycore.SceneEntity(unpack(arg))
  13. Polycore.__ptr_lookup[self.__ptr] = self
  14. end
  15. end
  16. function SceneEntity:testMouseCollision(x, y)
  17. local retVal = Polycore.SceneEntity_testMouseCollision(self.__ptr, x, y)
  18. return retVal
  19. end