Support our Sponsors:

Go Back   Touch Arcade > Developer Discussion > Public Game Developers Forum

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2014, 09:45 AM
Planetman Planetman is offline
Senior Member
 
Join Date: May 2014
Posts: 111
Default how hard to code drawing tools?

I
Was wondering how hard it was to code, drawing tools such as air brush etc?
Reply With Quote
  #2  
Old 08-14-2014, 11:23 AM
Blackharon's Avatar
Blackharon Blackharon is online now
Developer
iPad (4th Gen), iOS 7.x
 
Join Date: Mar 2010
Location: Canada
Posts: 852
Default

ranging from simple (see most toddler apps) to crazy hard (see paper by 53)
Reply With Quote
  #3  
Old 08-14-2014, 11:44 AM
Planetman Planetman is offline
Senior Member
 
Join Date: May 2014
Posts: 111
Default 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
Reply With Quote
  #4  
Old 08-14-2014, 12:56 PM
Blackharon's Avatar
Blackharon Blackharon is online now
Developer
iPad (4th Gen), iOS 7.x
 
Join Date: Mar 2010
Location: Canada
Posts: 852
Default

paper by 53

cost to create draw something

Last edited by Blackharon; 08-14-2014 at 12:59 PM.. Reason: added draw something
Reply With Quote
  #5  
Old 08-14-2014, 05:36 PM
Destined Destined is offline
Senior Member
iPhone 5, iOS 6.x
 
Join Date: Aug 2013
Posts: 689
Default

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.
Reply With Quote
  #6  
Old 08-14-2014, 06:20 PM
OnlyJoe OnlyJoe is offline
Member
iPhone 5s, iOS 7.x
 
Join Date: Sep 2013
Location: Auckland
Posts: 92
Default

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.
Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 2012, TouchArcade.com, LLC.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Copyright 2008 - 2011, TouchArcade.com. Privacy Policy / DMCA Copyright Agent