Development/cocos2d-x

RenderTexture 해상도 크기보다 크게 사용하기

후미카 2018. 10. 29. 14:44

RederTexture는 기본적으로 해상도 이상의 사이즈를 사용 할 수 업습니다.


이유는 Camera의 해상도를 넘어가는 부분은 렌더링에서 표시하지 않기 때문인데 이것을 바꿔주면 해결 할 수 있습니다.



    Size originDesignResolution = Director::getInstance()->getOpenGLView()->getDesignResolutionSize();
    Director::getInstance()->getOpenGLView()->setDesignResolutionSize(textureWidth, textureHeight, ResolutionPolicy);
    
    renderTexture->begin();
    
    node->visit();
    
    renderTexture->end();
    
    Director::getInstance()->getOpenGLView()->setDesignResolutionSize(originDesignResolution.width, originDesignResolution.height, ResolutionPolicy);