Cocos2D-X Fill Polygon with Texture

PRKit is an addition library to the cocos2d-x framework to easily fill polygons with texture.
PRKit efficiently triangulates the vertices with the provided triangulator.

PRKit provided by – http://precognitiveresearch.com/
Triangulator provided by – John W. Ratcliff
Link to github http://github.com/dmazzella/cocos2d-x-PRKit.git

Overview

  • PRFilledPolygon extends CCNode and overrides the draw method
  • PRRatcliffTriangulator is the interface provided to triangulate vertices
  • triangulate c++ implementation of triangulation algorithm

Lets take look to some parts that concerns us. (Skip to usage if not intrested in details)
PRFilledPolygon overrides the draw method and provides 2 implementations. The first one is OpenGL ES 1.1 and the second OpenGL ES 2.

Usage


  • Appreciate the recommendation. Let me try it out.

  • Good article. I’m experiencing a few of these issues as well..

    • metin

      thx. I’m not sure but I think they included a feature in the new version(cocos2d-x v3) for drawing texture in polygons. I’ll post it if I find anything.

Recent Posts

Recent Comments

Categories