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
Addition to new Multi-resolution adaption scheme #1289
Conversation
…solutionSize() on all platforms
fixed cocos2d#1289: CCControlButton update. Added zoomOnTouchDown property and setPreferredSize.
float zeye = m_obWinSizeInPixels.height / 1.1566f; | ||
if (m_pobOpenGLView->isRetinaEnabled()) | ||
zeye /= CC_CONTENT_SCALE_FACTOR(); | ||
return zeye; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about add a line space before "return zeye"?
…d not in setContentScaleFactor() Replaced tabs with spaces to match cocos2dx codestyle
Look at last changes, i I have considered your comments and added little changes for ios CCEGLView Anyway, if you won't pick this pullrequest i insist that you move assignment of m_bIsRetinaEnabled to enableRetina(). It will be more clear from point of logic :) |
As you can see, in samples/HelloCpp, we also use hd resources for all android devices. |
Yes, but you have different "design resolutions" for iphone without retina and other. Also you don't use "normal" resources for android devices with 480x320 resolution. The idea is to use the same design resolution as possible. As option, of course. |
moadib, I love this idea :) |
In our repos we have modified cocos2d so that remove word Retina from library and all classes. Only terms that we use in our logic are "design resolution" and "contet scale factor" :) |
Could you share your repos? |
No, it is in our local repo :) Ok, i think that @BorMor can share it later. |
Thank you. |
Take a look at pull-request of @BorMor (we work together) http://github.com/cocos2d/cocos2d-x/pull/1372 |
fixed cocos2d#1289: CCControlButton update. Added zoomOnTouchDown property and setPreferredSize.
fixed cocos2d#1289: CCControlButton update. Added zoomOnTouchDown property and setPreferredSize.
fixed #1289: CCControlButton update. Added zoomOnTouchDown property and setPreferredSize.
I've added ability to use
setContentScaleFactor()
in pair withsetDesignResolutionSize()
on all platforms.Example from real life, we have "iphone" and "iphonehd" resource folders and want make our android game with this resources.
We won't make additional assets which adopted for 720x480 resolution. But just scale all with
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(480, 320, kResolutionShowAll);
isn't as good as it can be. It is still use "iphone" resourcesWhat i suggest?
How it works?
It is also scaled to 720x480, but uses resources for retina. I think that everyone understand that downscaled texture looks better than upscaled :)
And it is work without any changes in game code.
Of course you still can use all as designed by developers.