★ TouchArcade needs your help. Click here to support us on Patreon.

how hard to code drawing tools?

08-14-2014, 09:45 AM
#1
Joined: May 2014
Posts: 135
how hard to code drawing tools?

I
Was wondering how hard it was to code, drawing tools such as air brush etc?
08-14-2014, 11:23 AM
#2
ranging from simple (see most toddler apps) to crazy hard (see paper by 53)

Looking for a writer? PM me

Game Designer of:
Family Feud 2 My First Huge Apple Feature!
Pickpawcket
And a bunch of other games you've never heard of!
08-14-2014, 11:44 AM
#3
Joined: May 2014
Posts: 135
paper

Quote:
Originally Posted by Blackharon View Post
ranging from simple (see most toddler apps) to crazy hard (see paper by 53)
What is paper by 53?


I guess draw something would be crazy hard category?

I don't really need super advanced tools sort of in the middle of that

Last edited by Planetman; 08-14-2014 at 11:46 AM. Reason: stupid
08-14-2014, 12:56 PM
#4
paper by 53

cost to create draw something

Looking for a writer? PM me

Game Designer of:
Family Feud 2 My First Huge Apple Feature!
Pickpawcket
And a bunch of other games you've never heard of!

Last edited by Blackharon; 08-14-2014 at 12:59 PM. Reason: added draw something
08-14-2014, 05:36 PM
#5
Joined: Aug 2013
Posts: 1,003
this really depends. I did some tests with this and it is a fun area of coding. It depends what you are doing, but there are some libraries to help you out depending if you do a little research.

It is interesting the cost of draw something.

Please follow me on twitter @JamesDestined I post lots of development from both my game creation and professional development.
Time to measure - Brain challenge https://itunes.apple.com/us/app/time...820864672?mt=8
The light box, can you solve it (free) (on google play too)
https://itunes.apple.com/us/app/the-...6300?ls=1&mt=8
08-14-2014, 06:20 PM
#6
Joined: Sep 2013
Location: Auckland
Posts: 115
So I have actually tried to do this a little with some photo apps I started working on, I found a pretty basic tutorial on it here:

http://www.raywenderlich.com/18840/h...app-with-uikit

But the real problem is when you get larger images. If you want to allow people to draw on full resolution photos, you can't use the method above. It just uses too much memory and goes way to slow, because you are basically making a very large context that is getting redrawn every time you do something, and the apple libraries don't seem to be designed for this. So the above method works ok if you only want something the same resolution as the screen, but larger sizes you need to use OpenGL to do it.

So the challenge with OpenGL is the max texture size (1024x1024 on lower devices), so I had to make some code that splits an image into segments, and then wrote another layer above this to paint with (which is basically rending a whole lot of point sprites onto a texture) this actually seems to work really fast. Then you can just change the fragment shaders to produce different brushes. What you can also do is create different texture layers, that can be blended together, creating something like the layers in photoshop. This approach is fast, and has a low memory footprint compared to trying to use a UIView directly. I mean it is still a lot of memory when dealing with big images, but this is the best way I have found.