Im new to cocos2dx and have been trying to port a game from Android (using canvas) to cocos2dx. I use the following code to create a tile using a png in android.
//create bitmap shader
Bitmap mBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.rock_texture);
BitmapShader mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
//add to paint
Paint mPaint = new Paint();
mPaint.setShader(mBitmapShader);
//draw on canvas
canvas.save();
canvas.clipPath(mPath);
canvas.drawRect(0, 0, w, h, mPaint);
canvas.restore();
Bitmap Shader doc http://developer.android.com/reference/android/graphics/BitmapShader.html How can I do the same thing in cocos2dx?
Using PRkit for cocos2dx, which does the same thing using OpenGL shaders. http://www.cocos2d-x.org/boards/6/topics/8101?r=12344#message-12344