How to create a custom polygon with texture mapping in cocos2d/JS? Where to start?

How to create a custom polygon with texture mapping in cocos2d/JS? Where to start?

hi. as far as I am concerned, Clipping node is one of good solution for u!
Thanks for your help. Clipping node might work with a simple polygon shape. But it’s not exactly what I’m looking for.
Every sprite has four vertices and two triangles where the texture is mapped on. Either I want to move those vertices or create custom vertices and triangles to map the texture on. Just can’t find a solution which works across multiple devices.

It seems there is no easy solution in JS. I was searching how I can draw a triangle with specified textures coordinates. It appears, the easiest way is to use shaders for that 
It would be great if anybody suggest another way to do this.