How to perform a bounds to clip operation?

hi all
in cocos2d we can use ui framework. using that we can salve clip to bound operation.
can any one tell me how to perform this operation in cocos2dx (with out using ui framework).

Hi, you can overload the visit function and define your scissor rectangle by opengles functions as follow.

void yourLayer::visit()
{
    glPushMatrix();

    glEnable(GL_SCISSOR_TEST);

    CCEGLView::sharedOpenGLView().setScissorInPoints(    // scissorRect is the rectangle you want to show.
        scissorRect.origin.x, scissorRect.origin.y,
        scissorRect.size.width, scissorRect.size.height);

    CCLayer::visit();
    glDisable(GL_SCISSOR_TEST);
    glPopMatrix();
}

Many Thanks @ James Chen. it is working fine.

James Chen wrote:

Hi, you can overload the visit function and define your scissor rectangle by opengles functions as follow.
[…]

Is there any way to do the same but using a Node as clipping area?

Thanks.