How to make Smooth Freehand drawing in ios? - ios

I followed THIS tutorial and i have two problems:
How to change the color of line when we are drawing it (not when drawing finished)?
How to round the ends of lines?

Use any of these nice examples :
Paint Pad
My-Palette
Drawing-View
ACEDrawingView
smooth-line-drawing-in-ios
Hope these helps you.

Related

Smooth free hand drawing brush in iOS swift?

In trying to develop an drawing app, where i can able draw line, circle and letter, etc. But drawn lines are not in smooth. Is there any sdk or library for variety of brush for smooth drawing.
Here is my screenshot of drawn lines
Any help will be greatly appreciated! Thanks in advance!!!

In iOS, is there a method to make a button move around arc line or circle?

I have a custom control like the picture below, it is too complicated to draw all the images using core graphics. So I use the images designer give, but the problem is how to make the small circle(which is actually a button) on the big white circle(which is an UIImageView) move aroud the big circle? Thanks in advance!
You need to calculate all circumference points. Just set centre of your image to the points calculated by you. Automatically your image will start moving in circle.

Drawing a line with hidden parts in cocos2d for ios

Say you have an array of points and an array of rects, and you want to do the following:
Draw a line that connects all the points in the point array, such that the parts of the line that are contained in at least one of the rects are not visible.
What is the best practice way to accomplish such a task in cocos2d ios?
This may sound like a hack, but if you are drawing the rectangles as well then you can draw them with a higher zOrder with respect to the line and the rectangles would could cover the parts of the lines they contain making those parts invisible.
Hope it helps!

How to mask sprites in cocos2d?

I've read Ray Wenderlich's tutorial on sprite masking: http://www.raywenderlich.com/4428/how-to-mask-a-sprite-with-cocos2d-2-0. However, my understanding of openGL is poor, and this tutorial doesn't produce the effect I desire. What I would like to do is to mask one sprite/layer with another, and move the sprite behind the mask to create a "shiny" animation, like so:
Additionally, how could I make the mask dynamic (ex: changing the text string), and how could I make a sprite or layer count its children as part of the mask?
I think you con do that with an animation, put the "reflection sprite" under the "mask sprite" and then move the "reflection sprite" from left to right.
I think this Github repository will help you.
https://github.com/tonybeltramelli/Cocos2D-Mask-Shader

Drawing curved lines in Corona, during a drag gesture?

I'm trying to implement a feature that allows the user to draw Curved lines whilst doing a drag gesture in Corona and so far have only been able to draw straight lines.
Can the community assist me with any code or links to tutorials that can assist me in implementing this?
Well you could do a curved line as a series of short straight lines, using an enterFrame listener to get the touch point each frame.
More generally, make sure to look at the Martian Control example for how they draw lines:
http://blog.anscamobile.com/2010/12/martian-control-another-open-source-game-made-with-corona-sdk/

Resources