0

I have a cclayer class with invisible button that is the size of the iphone 320x480 screen.

I've set it to have the visible property so that when the user taps on any part of the screen, it'll set itself to invisible and set the rest of my ccmenuitems to be visible.

I noticed that when the transparentbutton is 'visible' my fps drops to 30. When it toggles to be invisible and brings up the other 'visible' ccmenuitems, my fps goes back to 60fps.

Why does my app do this when there is a full screen transparent button and how do i work around this to maintain 60 fps?

taskinoor
  • 45,586
  • 12
  • 116
  • 142
Azeworai
  • 772
  • 3
  • 9
  • 25
  • I've removed the transparent button and implemented ccTouchesBegan within my CCLayer and got it to work the way I wanted without the FPS drop. - (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event – Azeworai Mar 06 '11 at 13:27

1 Answers1

2

Transparent things are costly to render, as it requires calculating the net effect after applying the transparency. Even if the view is full transparent (i.e. visible but alpha = 0), I guess these calculations are carried on. Full screen transparency might affect the performance. Instead of using invisible button try to detect the touch in some other way, if possible.

taskinoor
  • 45,586
  • 12
  • 116
  • 142