I stared writing a CCWindow which is no rocket-science:
@interface CCWindow : CCLayer
{
CCLayer * backgroundLayer_;
CCLayer * contentLayer_;
CCLayer * titleLayer_;
CCLayer * overlayLayer_;
}
@property (nonatomic, retain) CCLayer * backgroundLayer;
@property (nonatomic, retain) CCLayer * contentLayer;
@property (nonatomic, retain) CCLayer * titleLayer;
@property (nonatomic, retain) CCLayer * overlayLayer;
@end
but then I recocnized that CCLayers do not support clipping. Why ?
I attached my CCScissorLayer class which I enhanced like the guy in this post :
http://www.cocos2d-iphone.org/forum/topic/3993?replies=8#post-62639
Well, yes - glScissor does not support matrix operations - so rotation will not
be recocnized. If you want that, may be you could use CCRenderToTexture stuff
to optain this - but under big performance issues.
But may be you could lock the rotation if clipping is enabled - or NSAssert if
rotation is beeing set while clipping is enabled and vice versa ( if rotation
!= 0 and setting clipping to YES ).
May be its a good starting point to support clipping for nodes. Later on it
could be that some one will implement a rotation support via render to texture
- like
use "glScissor" if rotation == 0 else "Render to texture"
Original issue reported on code.google.com by hamm.h...@googlemail.com on 10 Nov 2010 at 10:24
Original issue reported on code.google.com by
hamm.h...@googlemail.com
on 10 Nov 2010 at 10:24Attachments: