I want to draw a brush starting when I touch the screen and ending when I lift.
The brush that I want to draw could be a specific texture image.
How could I do ? I'm just watching to use RenderTexture class but I'm not sure...
A fast, easy to use, free, and community supported 2D game engine
I want to draw a brush starting when I touch the screen and ending when I lift.
The brush that I want to draw could be a specific texture image.
How could I do ? I'm just watching to use RenderTexture class but I'm not sure...
Yep, render texture is the right way to go. I have a pretty comprehensive paint program working using rendertexture as the back end. One day I'll finish it and release it..
Splat... was practically a painting app... with shooting!
Could you please post sample code to use RenderTexture to simulate painting brush ? need help...
*Bump* I would be intrested in this code aswell
You already have it; check the examples..
Oh sorry ! I didn't check the newest examples so I didn't see the new example. I have a question though, currently I'm using chipmunk segment shapes too draw, from the segment shapes I can get the begin and end points to draw the render texture part I think, I'm just wondering how erasing would work ? I would want the texture2d part to go away when I remove the segment shape, is this possible ? Thanks in advance,
xStoryTeller
Yeah, just render into the alpha channel instead of the color channels..
Yeah, just render into the alpha channel instead of the color channels..
It seems like I'm annoying you somewhat, sorry ! Its my first time working with OpenGL, and Objective C aswell, I'm just trying to learn all I can. I'll try to figure out what you mean with render into the alpha channel and how to apply it, thanks a lot.
glColorMask(FALSE, FALSE, FALSE, TRUE); // only draw into the alpha channel
// draw some stuff
glColorMask(TRUE, TRUE, TRUE, FALSE); // back to normal
@xStoryTeller - we don't expect you to know OpenGL, we do expect you to search before you post. If it was me, I would have searched for RenderTexture and read EVERY post before I asked a question. If you had of done that you would have discovered slipster216 had added a demo to the code repository. You would have also discovered this thread where I posted code to do what you are trying to do now (i.e. erase based on alpha).
You must log in to post.