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!!!
Related
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.
I am trying to create a spotlight effect in my story book such that as the character moves around from one location to the other then the light focus moves towards that same character.Is it possible to do that in Corona SDK? How can I do that coz sprites aren't
helping me.Any idea regarding this.
I found some reference telling me that I can't do that
http://web-c2.anscamobile.com/forum/2012/10/27/dynamic-shadows-2d
http://developer.coronalabs.com/forum/2012/09/13/lightingshadows
Those two threads seem pretty definitive. You could create a spotlight pretty easy, but you can't cast shadows and the light moves different directions very easily.
If you want to do a spotlight without shadows, just create an image that's all black with a transparent hole in them middle that has some feathering around the hole. Make the black partially transparent so you can see the scene but have it a bit darker. You can them move the image around to be your spot light. You can also do it with a maskk (see the Flashlight example in the sample code)
I am writing a small game (it is 2d) in IOS using Opengl as a way to get comfortable with opengl. I am using the Texture2D class from the CrashLanding demo. I am using this to generate text for the score. When the text is drawn it is upside down. In the code there is comments about the texture being loaded upside down but I can not find a way to render it the correct way. Any help would be greatly appreciated.
OpenGL and your image loading code do not agree on where the origin is. OpenGL starts in the lower left hand corner, while your picture starts in the upper right hand corner. You can apply a transform to the picture in your app like the CrashLanding demo does. Or even simpler pre flip the image in an editing program such as Photoshop. This will work if your image will only be used as an OpenGL texture in this app. If you need to display this same picture elsewhere you'll need to keep a non flipped version, or figure out how to apply the transform.
I'm creating an ios drawing app and would like to understand how to rotate the texture I'm using for drawing to have the texture follow the direction of my stroke.
Sketchbook for iOS and brushes are two apps that Ive seen accomplish this.
Does anyone have any idea of how to achieve this?
Here's an example of the concept that I'm trying to capture: http://drawsketch.about.com/od/learntodraw/ss/pencilshading_5.htm
Attached is a screenshot from the sketchbook app of this in practice.
UPDATE:
I was able to figure this out (thanks to SO community for helping out!) and posted my answer here: https://stackoverflow.com/a/11298219/111856
You can just rotate the brush texture as you're drawing it. You can get the angle by taking the arctangent of the y delta divided by the x delta for each segment of the stroke:
atan2(newY - prevY, newX - prevX);
Then rotate your brush texture by that amount before blending it at each point along the line.
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/