Lightning Shadow effect in CORONA SDK - lua

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)

Related

iOS: How can you change the color of a part of UIImage?

In the Nike app on iOS if you customize a shoe somehow they let you select different colors for different sections of the shoes (midsole red, or tongue green for example). I am wondering how do you do this on iOS? The shapes are pretty irregular so making a Bezier curve seems unlikely. The image doesn't move either so it doesn't seem like they are swapping images. Does anyone have any clue about a way to do is?
One thing I did notice is the images is fuzzy when you make a change and then comes into focus after a delay but not sure if that is a clue or not. :shrug:
Here is an example
grey toe
black toe
They are swapping images, in fact they are all fetched when entering this screen. So they are all present on the memory when swapping between them, that's why it seems that they are changing colors.

Swift / SpriteKit: How to create a water drop effect?

i wonder how the following effect could be made in Swift (SpriteKit).
I think about adding some ShapeNodes and fill them with the background image with -yscale 1.
But i think this effect was made somehow different, because the background image isn't just mirrored horizontally - it also has some graphics effects on it (it is mirrored in the shape the water pearl has and so on).
Was it done with a ShaderNode?
Does someone has an idea how i could create a same effect in SpriteKit - like water pearls which looks like they are on the "camera" and they mirror the background "waterpearl like"?
Thank you.
Hmm well you could create a bunch of water images and have them displayed randomly on the screen at some z position, however I think this effect was made in another program like unity or something of the sort, Your best bet is to create transparent water droplets as images and have them displayed randomly on your screen.

How to do Water color painting in iOS using CoreGraphics? [duplicate]

I have been working with OpenGL in iOS, and setting the colors with glColor4f(r,g,b,a) and then drawing my own color on a white UIImageView. I basically have a brush, which is then moved around my user's touch, and then it paints the color onto the canvas. But this color needs to be water paint (like smudged color)
Does anyone understand/knows how to get a water color like this app does, and how the background UIImageView has a texture on it?
https://itunes.apple.com/us/app/hello-watercolor/id539414526?mt=8
or checkout water paint in this. http://www.fiftythree.com/paper
I created a bounty on this as I am really having a hard time to grasp how to derive such smooth flowing colors out of the normal colors. Even if you guys point me in the right direction, or to some sample code on how I can get the effect of water-paint, it would be really helpful ^_^
And as a bonus, it would be also be helpful if you can point out to me how to get canvas on which it is painted on looks realistic, and blended with the paint? Does Blending/GLSL have to do with any of this?
Is there any sample project on this?
If you are still struggling with the basics of getting realistic looking water colors working, you may want to experiment/prototype in photoshop first.
http://www.zoepiel.com/tutorials/watercolor/ shows some very effective tricks for creating watercolor images with simple tools.
The most interesting one is to multiply a group of watercolor layers with a greyscale watercolor paper image. The texture of the paper makes some parts remain white, and other parts saturate with color, just like real watercolor.
Each layer remains 'wet' in the sense that the colors within it blend, but the layers are 'dry' with respect to each other.
She also explains some of her brush and blur settings and shows what they do.
Once you can produce the desired effect in photoshop, you'll have clear specifications of what you want to do and you'll be quite a bit closer to programming it out.
Looking at the examples you posted, it looks like they are using a simple Gaussian Blur with a radius of double your brush size. This may be an incomplete solution, but it's at least the first level.

Render water-paint in iOS

I have been working with OpenGL in iOS, and setting the colors with glColor4f(r,g,b,a) and then drawing my own color on a white UIImageView. I basically have a brush, which is then moved around my user's touch, and then it paints the color onto the canvas. But this color needs to be water paint (like smudged color)
Does anyone understand/knows how to get a water color like this app does, and how the background UIImageView has a texture on it?
https://itunes.apple.com/us/app/hello-watercolor/id539414526?mt=8
or checkout water paint in this. http://www.fiftythree.com/paper
I created a bounty on this as I am really having a hard time to grasp how to derive such smooth flowing colors out of the normal colors. Even if you guys point me in the right direction, or to some sample code on how I can get the effect of water-paint, it would be really helpful ^_^
And as a bonus, it would be also be helpful if you can point out to me how to get canvas on which it is painted on looks realistic, and blended with the paint? Does Blending/GLSL have to do with any of this?
Is there any sample project on this?
If you are still struggling with the basics of getting realistic looking water colors working, you may want to experiment/prototype in photoshop first.
http://www.zoepiel.com/tutorials/watercolor/ shows some very effective tricks for creating watercolor images with simple tools.
The most interesting one is to multiply a group of watercolor layers with a greyscale watercolor paper image. The texture of the paper makes some parts remain white, and other parts saturate with color, just like real watercolor.
Each layer remains 'wet' in the sense that the colors within it blend, but the layers are 'dry' with respect to each other.
She also explains some of her brush and blur settings and shows what they do.
Once you can produce the desired effect in photoshop, you'll have clear specifications of what you want to do and you'll be quite a bit closer to programming it out.
Looking at the examples you posted, it looks like they are using a simple Gaussian Blur with a radius of double your brush size. This may be an incomplete solution, but it's at least the first level.

Coloring Shapes in iOS app

We are building an iPad kids application in which a kid is requested to color different shapes with specific color. For example, consider an image with sky and trees , etc. all overlapping and a kid has selected a color for example "Blue" and then he taps the sky , the sky should turn to blue otherwise it should say "wrong color"
My questions are:
1- How to implement the coloring of the sky only with the selected color. We have implemented a Coco2d Floodfilling but it is too slow.
2- How to tie each part of the image with a specific right color. We suggested loading a fully colored image in a background layer and testing it at the tap .... BUT how to implement it.
Thanks
Are the shapes originally vectorial? If so, a solution would be to work directly with them as vectors, parsing them into CoreAnimation shapes.
You can give a try to SVGKit or get some inspiration from it. You'll get CAShapeLayers where you can change the fillColor property.
I believe that this way would be much more responsive (and the app size much more lighter) than doing tricks with images ;-)

Resources