There are now over 1 000 000 apps in the App Store. And there is not a single one like Foldify. If you haven’t seen it already then you definitely should:
Foldify is an Indie app, created by a team of 3:
- Engineering – Krzysztof Zabłocki
- Design – Mariusz Ostrowski & Renata Ostrowska
Let’s talk about how it was created and the technical aspects.
Basics
Foldify is using cocos2d 2.x for 2d rendering, and on top of that there is custom 3d rendering code.
Why not cocos3d? It doesn’t work with shaders, and I like shaders a lot.Besides, the problem with cocos3d is the lack of a GitHub account. So there is no way to send pull request to the authors.
During the development of Foldify I’ve encounter few missing features in cocos2d, which were necessary:
I needed render texture with support for depth and stencil buffers, and also an easier way to render content into it.
Stencil buffers can be used for many effects, like shadowing and marking parts of scene immutable ( preventing drawing on them ). The second usage was actually used in Foldify to prevent the user from drawing outside the grid. These changes are now part of cocos2d 2.x.
Gestures
When we started working on Foldify, we decided we didn’t want to follow standard patterns, we wanted to make new ones.
One place where we could implement that was Creation Layer. What if instead of changing brush size we could use gestures to zoom in and out of virtual paper ?
The problem with changing brush size is that you can’t really change your finger size or make it transparent, so if you set small brush size how are you actually gonna see the area you are drawing on ?
I’m not skilled graphical artist, I want something simple and something I can use with ease. Instead let’s try zooming in on the area I want to draw detail on, now you can still use your finger-sized brush but the relative size of drawing is way smaller ( because you are zoomed in ).
One of the missing features of cocos2d is the lack of Gestures. We have touches[Began,Moved,Ended] which may work for simple games, but it’s just not usefull for heavy gesture driven apps.
That’s why I’ve created Category for adding gesture recognizers in any cocos2d version. Once you include this code in your project, you can add any gesture recognizer to any CCNode and it works flawlessly. This is the same code that drives Foldify creation, where you can use pinch/rotate/pan gestures at the same time.
Drawing
When I started working on Foldify, I was surprised by the lack of good algorithms for drawing lines. There were some materials, but people were using different bezier calculations or cat-mull roms algorithms, which really required a lot of control points to create nice smooth lines. And there was not a single article that would explain how to create line drawing from Scratch to final anti-aliased lines.
I’ve also been impressed by how easy and beautiful is to draw with Paper by Fifty Three. They have created line drawing algorithm which was based on the speed of strokes.
I’ve decided to come up with proper algorithm for line drawing, that would explain whole algorithm from scratch to complete anti-aliased lines. That’s how I’ve created this tutorial.
Conclusion
Foldify is probably the biggest Indie project I’ve worked on, I’ve been doing it after hours during my full-time job, which wasn’t that easy, working long nights and getting little sleep.
The feedback we received from everyone is just amazing. It’s really great to see your work appreciated!
Most of all I’d like to thank all people that contributed to cocos2d, as this is probably the best 2d framework. And the community of cocos2d is full of really creative people. I hope my contributions will help you create fascinating games!
If you have any questions, don’t be afraid to ask
Thank you for reading. Let’s keep in touch on twitter @merowing_






Impressive… Let us know once live please
Foldify is live! https://itunes.apple.com/us/app/foldify/id527118971
It’s live, don’t have my iPad with me right now, but going to buy this tonight, looks awesome and thank for sharing the methods
Already started playing with it! Very nice little app! Good work!
Love the idea of the app and REALLY want to buy it, but it doesn’t support iPad 1st Gen?! Why oh why!?
Bit disappointed doesn’t work on iPad 1, people deprecating hardware too fast.
How many time did you spend programming the app?
Bought this as soon as I saw it and told everybody I know about it. It’s such a brilliant idea.
I believe the reason it doesn’t support 1st gen iPad is due to its low memory. I don’t know the specific issues that Krzysztof ran into, but I know that I am constantly battling to keep texture memory usage low enough for 1st gen. You can work around the limitations, but they are limitations.
Foldify is an excelent app. And very fun!
Congrats!
Excellent App Krzysztof and thank you for sharing some insights into your development process of the App.
If you ever get the time, would you mind sharing some pointer how you did the 3d rendering code?
TacoGraveyard is right, the biggest problem with foldify is pushing the limits, using some low level stuff to get some of functions working right. iPad 1 was just too risky to support, we want to keep improving app and iPad 1 would limit us quite a lot.
As for 3D rendering I inherited from Node and wrote my own scene management and rendering with simple opengl commands, that was quite easy the biggest problem with cocos2d was that it doesn’t really support multiple opengl views, had to hack around that quite a bit
Awesome idea! Looks one of the top 5 apps I’ve seen!
really nice ! congrats for your featuring all around the world ! It’s going to be a very good christmas for you and your friends !
How did you do the 3d stuff with Cocos2d?
Looks amazing, great work!
Foldify is an Indie app, created by a team of 3….
I believe at least 98% apps in App Store (in total of 1M apps) are Indie apps & at least 30% of them are created by the team of 1.
Thnx man nice share….
Very impressive app, thanks for sharing some of the algorithms. Cute marketing video too.