- Home /
Painting using a brush for iOS
Hello everyone,
I'm trying to make a painting app for iOS but I don't know what is the best approach in implementing a brush. First I started by using a Texture2D and SetPixels, which did what I wanted it to, but the Apply function was making the whole app too slow so I had to change direction. I though of using OpenGL but as I want more complex behavior from just drawing lines, I didn't think that was I viable solution.
Therefore right now I'm trying to make this work by drawing on a mesh. Based on where the user clicks I generate vertices and triangles based on the width I want. This works perfectly for solid lines. However right now I want to add an air brush (similar to Windows Paint, or what they use for graffiti), and something like an oil / waterbrush. Basically all of the above require a triangle on the mesh to be drawn with either color variation or using a texture. I'm pretty sure I should be able to do something like that using shaders and applying the appropriate texture, but I'm not as knowledgeable to figure how to make it work.
Can I get any suggestions on how I can achieve what I'm trying to do, and if this is the right direction or if there is an alternative?
Thanks, Fotos
Unity Paint did work out the way I wanted to. $$anonymous$$y initial approach was similar to that though using the Texture2D, but for some reason when I was trying it out it spent too much time in the textures' Apply function. So right now I'm trying to figure out the reason behind that, as the two codes look very similar. Thanks for the solution. I had seen Unity Paint myself before but since it was using Texture23D I didn't try in on the iPad.
Hello, I'm trying to make a painting app for iOS but how to draw a pencil stroke?
Answer by BeardOfFury · Nov 11, 2013 at 04:01 AM
You could check out:
It's a demo made by Aron Granberg a while ago. It has pencil, line, eraser, and brush tools. I'm currently using it as a base for my own painting program. The original scripts are in Javascript but someone in the comments made a C# version.