Hi
I want to draw on an image which I put as background
however let me explained what happened when I followed your suggestions
1.If I put render the background image into renderTexture either only my background picture seemed and my drawings did not or my drawings seemed but not my background picture .I've tried to change their z-order and somehow it worked but then I figured out that when I erase the lines that I draw it erases the background image too
2.I've added the background image like this
only this time I could be able to draw and erase lines on top of background image but this time my image seems transparent and it iritates the user
Can you suggest me a spesific way to handle this ? I thought on this a lot and it seems to me that only way to draw and erase the lines on top of an image is using layers such as photoshop
Then :
I've made something like this according to kryzstofz suggestion
if (self.bgNativeImage) {
[backgroundLayer setZOrder:1];
[backgroundLayer visit];
}
[renderTexture end];
now I can draw on image without any problem however when I try to erase the lines that I already draw.(with below algorithm) it also erases the background image
ccColor4F color = {0, 0, 0, 1};
if (!isPencilActive) {
ccColor4F eraserColor = {1,1,1,1};
color = eraserColor;
} else {
color = drawingColor;
}
Do you have any idea about it?
Thanks
Tolga
Hi I want to draw on an image which I put as background however let me explained what happened when I followed your suggestions
1.If I put render the background image into renderTexture either only my background picture seemed and my drawings did not or my drawings seemed but not my background picture .I've tried to change their z-order and somehow it worked but then I figured out that when I erase the lines that I draw it erases the background image too 2.I've added the background image like this
only this time I could be able to draw and erase lines on top of background image but this time my image seems transparent and it iritates the user Can you suggest me a spesific way to handle this ? I thought on this a lot and it seems to me that only way to draw and erase the lines on top of an image is using layers such as photoshop
Then : I've made something like this according to kryzstofz suggestion
[renderTexture begin];
NSMutableArray *smoothedPoints = [self calculateSmoothLinePoints]; if (smoothedPoints) { [self drawLines:smoothedPoints withColor:color]; }
if (self.bgNativeImage) { [backgroundLayer setZOrder:1]; [backgroundLayer visit]; } [renderTexture end];
now I can draw on image without any problem however when I try to erase the lines that I already draw.(with below algorithm) it also erases the background image
ccColor4F color = {0, 0, 0, 1}; if (!isPencilActive) { ccColor4F eraserColor = {1,1,1,1}; color = eraserColor; } else { color = drawingColor; } Do you have any idea about it? Thanks Tolga