cocos2d-x自适应屏幕 和 设置当前层显示区域

cocos2d-x自适应屏幕:

	CCEGLView* eglView = CCEGLView::sharedOpenGLView();
	eglView->setDesignResolutionSize(640, 960,kResolutionShowAll);


 

//设置当前层显示区域
void MenuLayer::visit()
{
    glEnable(GL_SCISSOR_TEST);
	//CCPoint point = convertToWorldSpace(CCPointZero);
	CCPoint point = convertToWorldSpace(CCPointZero);
    CCDirector::sharedDirector()->getOpenGLView()->setScissorInPoints(point.x, point.y+0, 640,590);
    CCNode::visit();
    glDisable(GL_SCISSOR_TEST);
}


 

你可能感兴趣的:(cocos2d-x自适应屏幕,CCLayer显示区域设置)