Skip to content

Instantly share code, notes, and snippets.

@kazukitanaka0611
Last active August 29, 2015 13:57
Show Gist options
  • Save kazukitanaka0611/9887094 to your computer and use it in GitHub Desktop.
Save kazukitanaka0611/9887094 to your computer and use it in GitHub Desktop.
ClipingSprite
void ClipSprite::visit()
{
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCRect bounds = CCRectMake(0, 0, winSize.width, 100);
glEnable(GL_SCISSOR_TEST);
CCEGLView::sharedOpenGLView()->setScissorInPoints(bounds.getMinX(),
bounds.getMinY(),
bounds.size.width,
bounds.size.height);
CCNode::visit();
glDisable(GL_SCISSOR_TEST);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment