1

i need to do a scratch effect to reveal the layer beneath, that would be for me to play with the alpha channel of an image. What would be the best way to go forward?

thanks.

genpfault
  • 51,148
  • 11
  • 85
  • 139
user281300
  • 1,427
  • 2
  • 19
  • 31

3 Answers3

2

There's a question about this here: Create masking effect over a view

Community
  • 1
  • 1
Matt
  • 4,849
  • 3
  • 26
  • 23
1

As I see it, the best way to do this is to use openGL. Just lay the image in a UIImageView, then place an opaque openGL layer on top. Then draw using GL_LINE_STRIP, and a glBlenFunc(GL_ZERO, GL_ZERO) on user touch.

Beaker
  • 1,633
  • 13
  • 22
0

You could set the modalTransitionStyle property of a UIViewController to UIModalTransitionStylePartialCurl or UIModalTransitionStyleCrossDissolve and then display it using

[[self navigationController] presentModalViewController:someVC animated:YES]`

Not sure whether this would give you the desired effect though.

(This is how the PartialCurl looks like.)

Community
  • 1
  • 1
fabian789
  • 8,348
  • 4
  • 45
  • 91
  • Even better would be to use _UIModalTransitionStyleCrossDissolve_ which is like a fade effect. – Linuxmint Dec 09 '10 at 18:54
  • thanks for the advice but it will have to depend on the touch area. Not sure I have this kind of conrol using the uimodaltransition. – user281300 Dec 11 '10 at 11:17