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

High res image loading uses the low res content scale factor #359

Open
totallyeviljake opened this issue Oct 7, 2013 · 2 comments
Open

Comments

@totallyeviljake
Copy link
Member

From codeplex:

https://cocos2dxna.codeplex.com/discussions/461066

The system loads a high res image properly, but it uses the low res content scale factor which then makes the high res image too large (upscaled).

@doubleday
Copy link
Contributor

When using the scale hack mentioned in the discussion I run in the problem that ConvertToNodeSpace does not work anymore for in bounds calculations. When I'm doing

var converted = ConvertToNodeSpace(touch.Location);

The converted x, y will be doubled. I guess this is collateral damage and will not be an issue when this is fixed properly?

@doubleday
Copy link
Contributor

Me again. Just found out by checking cocos2d-x that I need to set the content scale factor on the director.

So for ios this works fine for me:

var height = CCDrawManager.FrameSize.Height;
if (height > 480)
    height /= 2;

CCDrawManager.SetDesignResolutionSize(320, height, CCResolutionPolicy.ShowAll);
CCDirector.SharedDirector.ContentScaleFactor = CCDrawManager.FrameSize.Width / CCDrawManager.DesignResolutionSize.Width;

So my problem is solved and this might not be a bug after all...

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

2 participants