Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
minggo opened this issue Sep 30, 2014 · 1 comment
Closed

Comments

@minggo
Copy link
Contributor

minggo commented Sep 30, 2014

Note

This issue is migrated from here. It was created at 2014/03/24 13:17:48 +0000

Description

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

@minggo
Copy link
Contributor Author

minggo commented May 7, 2015

It is fixed.

@minggo minggo closed this as completed May 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant