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

Default CCTextField input text is displaced on iPhone 6 Plus #1193

Open
jonnyijapan opened this issue Jan 29, 2015 · 1 comment
Open

Default CCTextField input text is displaced on iPhone 6 Plus #1193

jonnyijapan opened this issue Jan 29, 2015 · 1 comment

Comments

@jonnyijapan
Copy link

I made a simple test app, portrait mode targeting iPhone (no 6/6Plus launch image) with just a CCTextField.

The CCTextFIeld looks okay on iPhone 5s, but the input cursor and text is too high on iPhone 6 Plus.

Sample project: https://dl.dropboxusercontent.com/u/147970342/githubissues/cocos2d34betatextfieldtest.spritebuilder.zip

Cocos2D version is the one bundled with SpriteBuilder 1.4.0 (20150127ish)

iPhone 5s looks okay:
iphone 5s_looks okay

iPhone 6 Plus, cursor and text origin too high:
iphone 6 plus_input text origin too high

@jonnyijapan
Copy link
Author

I think I found out how to fix this. There is a line in init of CCPlatformTextFieldIOS:

_scaleMultiplier = [CCDirector sharedDirector].contentScaleFactor/[UIScreen mainScreen].scale;

It really messes things up if you run your app on an iPhone 6 Plus (maybe also iPhone 6?) in iPhone 5 mode, i.e. scaled mode. I just change to

_scaleMultiplier = 1.0;

and it works for my app... Not sure if this breaks things if you don't run in scaled mode, or on other occasions.

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