ScreenShape.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. require "Polycode/ScreenMesh"
  2. class "ScreenShape" (ScreenMesh)
  3. function ScreenShape:ScreenShape(shapeType, option1, option2, option3, option4)
  4. if self.__ptr == nil then
  5. self.__ptr = Polycore.ScreenShape(shapeType, option1, option2, option3, option4)
  6. end
  7. end
  8. function ScreenShape:Render()
  9. return Polycore.ScreenShape_Render(self.__ptr)
  10. end
  11. function ScreenShape:setStrokeColor(r, g, b, a)
  12. return Polycore.ScreenShape_setStrokeColor(self.__ptr, r, g, b, a)
  13. end
  14. function ScreenShape:setStrokeWidth(width)
  15. return Polycore.ScreenShape_setStrokeWidth(self.__ptr, width)
  16. end
  17. function ScreenShape:setGradient(r1, g1, b1, a1, r2, g2, b2, a2)
  18. return Polycore.ScreenShape_setGradient(self.__ptr, r1, g1, b1, a1, r2, g2, b2, a2)
  19. end
  20. function ScreenShape:clearGradient()
  21. return Polycore.ScreenShape_clearGradient(self.__ptr)
  22. end
  23. function ScreenShape:setShapeSize(newWidth, newHeight)
  24. return Polycore.ScreenShape_setShapeSize(self.__ptr, newWidth, newHeight)
  25. end
  26. function ScreenShape:addShapePoint(x, y)
  27. return Polycore.ScreenShape_addShapePoint(self.__ptr, x, y)
  28. end