Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Possible Duplicate:
Can I achieve a torchlight effect (lighter area around a light source) in a 2D game?

I want to have a picture as a background, say this:

background

Then I would like to apply a mask, just a circle with blurred edges, so it looks like this:

masked

The idea is to simulate something emitting. Is this a good way of simulating light or should I use another method? And if so how? And I'm not really sure how to apply this method.

share|improve this question
    
I think your question is a duplicate of the one I linked. For posterity, I have also edited your question to contain the same content as the SO question you linked to, since I have also flagged the SO question to be closed/deleted as a duplicate of this one (it is more appropriate here). –  Josh Petrie Aug 11 '12 at 18:13
    
well you removed the iPad out of the title so no i got an answer for mac osx not for iOS so yeah thanks.. –  user1586195 Aug 11 '12 at 20:45
    
@user1586195 You can always edit your post and add "iPad" back in if that's so important to you. Also: The Core Image Framework is available on iOS, so the answer you got applies to iOS as well. –  bummzack Aug 12 '12 at 8:51
add comment

marked as duplicate by Nicol Bolas, Josh Petrie, bummzack, Byte56, Noctrine Aug 15 '12 at 20:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

You could use the Core Image CISpotLight filter:

CIImage *inputImage = // your image here
CIFilter *spotlight = [CIFilter filterWithName:@"CISpotLight"];
[spotlight setDefaults];
[spotlight setValue:inputImage forKey:@"inputImage"];
CIImage *spotlightImage = [spotlight valueForKey:@"outputImage"];

See the Core Image Programming Guide for more information.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.