Projects > cpp > Issues > Bug #4532

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

RenterTexture content stretched based on visible screen size [includes fix?]

Bug #4532 [Closed]
Romain 2014-03-24 13:17 . Updated about 2 years ago

The content (size of pixels) is scaled by this ratio: size of screen / size of RenderTexture.
So a smaller RenderTexture content will be scaled up (pixels scaled up).
Expected behaviour: the screen size and RenderTexture size should not have any effect on the content size. A RenderTexture with default scale (1) should not be stretched.

Fixed (?) :
in RenderTExture.h:
//fullRect: the total size of screen
//fullViewport: the total viewportSize

in RenderTExture..cpp, it is switched
_fullRect = _rtTextureRect = Rect(0,0,w,h);
Size size = Director::getInstance()->getWinSizeInPixels();
_fullviewPort = Rect(0,0,size.width,size.height);

Should be:
_fullviewPort = _rtTextureRect = Rect(0,0,w,h);
Size size = Director::getInstance()->getWinSizeInPixels();
_fullRect = Rect(0,0,size.width,size.height);

This fixed the issue described.

It is also in my reply to this thread:
http://www.cocos2d-x.org/forums/6/topics/45860

walzer@cocos2d-x.org 2014-10-08 02:59

Redmine issue system is closed, we are using github issue system instead.

This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8380

Atom PDF

Status:Closed
Start date:2014-03-24
Priority:Low
Due date:
Assignee:-
% Done:

0%

Category:all
Target version:-

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.