ScreenEvent.lua 460 B

12345678910111213141516171819202122232425262728
  1. require "Polycode/Event"
  2. class "ScreenEvent" (Event)
  3. ENTITY_MOVE_TOP = 0
  4. ENTITY_MOVE_BOTTOM = 1
  5. ENTITY_MOVE_UP = 2
  6. ENTITY_MOVE_DOWN = 3
  7. function ScreenEvent:ScreenEvent(...)
  8. for k,v in pairs(arg) do
  9. if type(v) == "table" then
  10. if v.__ptr ~= nil then
  11. arg[k] = v.__ptr
  12. end
  13. end
  14. end
  15. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  16. self.__ptr = Polycore.ScreenEvent(unpack(arg))
  17. Polycore.__ptr_lookup[self.__ptr] = self
  18. end
  19. end