Xcode image/pixel manipulation realtime

Go To StackoverFlow.com

-1

Hi I'm looking to do the following: For a game, Create some effects based on the current view. The code needs to grab part of a view then manipulate it. One I need is "glass", so when the character walks behind the glass(or where the glass should be), the code will grab the image behind the glass and stretch it and reprint it where the glass should be, to give the effect of walking behind a lens.

What is the best way to do this?

I've never tried any thing like this before, so any help will be great!

2012-04-03 20:13
by Scott Walker
Xcode is just the name of the IDE - are you talking about CocoaTouch (iOS), Cocoa (OS X), Carbon, or what - Paul R 2012-04-03 20:33


0

I think you're asking about the image manipulation capabilities of the cocoa framework, in which case I reccomend looking into CoreImage:

http://developer.apple.com/library/mac/#documentation/graphicsimaging/Conceptual/CoreImaging/ci_intro/ci_intro.html#//apple_ref/doc/uid/TP30001185

The NSBox draws on top of the player view, the resulting composition gets a CIFilter (distortion) applied to it before drawing.

2012-04-03 20:52
by awiebe
Ads