Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Invalid text box position with "Screen Space - Camera" #44

Open
eximarus opened this issue Jun 29, 2017 · 11 comments
Open

Invalid text box position with "Screen Space - Camera" #44

eximarus opened this issue Jun 29, 2017 · 11 comments

Comments

@eximarus
Copy link

eximarus commented Jun 29, 2017

hello. first of all I want to thank you for your efforts in this amazing plugin. On the android demo project the text appears to be out of screen for me (or at least not inside the textfield). Would be really cool if anyone knows a fix for this.

@eximarus eximarus closed this as completed Jul 2, 2017
@eximarus eximarus reopened this Jul 2, 2017
@eximarus eximarus changed the title app crashing on iOS text out of screen on android Jul 2, 2017
@Hemaolle
Copy link

So you are not seeing the input text at all? Or is it partially visible? Could you post a screenshot?

@eximarus
Copy link
Author

eximarus commented Jul 12, 2017

it seems to be dependant on the device. on one device I didnt see any text at all, on another the text was slightly outside of the textfield and on the one im using now it looks perfectly fine... the thing is though I didnt change anything. on all devices i just ran the demo project the way it came with the plugin

@Hemaolle
Copy link

Sounds interesting. Is it possible that it would be just a UI layout problem in the demo scene? I don't remember hearing about this issue before.

@raphac
Copy link

raphac commented Aug 23, 2017

Hello
I'm not sure if it is the same problem, but I have a scene, where I can reproduce it (demo, only 30 days available). The problem is on the canvas. When I set the Render Mode to "Screen Space - Camera", the text is outside of the inputfield and very small.

When I change the camera inside of NativeEditBox, the it works for me:
Vector3 screenCoord = RectTransformUtility.WorldToScreenPoint(Camera.current, corners[i]);
If I don't have a camera, current is null and if I have Canvas Render Mode Screen Spce - Overlay and I have a camera then Camera.current is the main camera:
Debug.Log($"Current camera is null: {Camera.current == null}. Current camera is mainCamera: {Camera.main == Camera.current} ");
Could that be a solution?

@Hemaolle
Copy link

So Screen Space - Overlay worked?

@connself
Copy link

When I set the Render Mode to "Screen Space - Camera",Multiple scenes NativeEditBox is always displayed at the top.
How to do?

@Hemaolle
Copy link

Is it possible for you to use "Screen Space - Overlay" instead?

@connself
Copy link

Thank you!
I'm try using SetVisible(),
I have a question: ios Square keyboard can not enter text.

@Hemaolle
Copy link

No problem :)

Please open another issue for the iOS stuff.

@raphac
Copy link

raphac commented Aug 24, 2017

So Screen Space - Overlay worked?

Exactly, but when I change to Screen Space - Camera, then it doesn't work correctly, and when I set the Camera.current in the NativeEditBox, it works. But I don't know if there are other problems with this fix.

@dongxiansuixin
Copy link

"RectTransformUtility.WorldToScreenPoint" method works with "Screen Space - Overlay" Render Mode, but not works well with "Screen Space - Camera". Just use WorldToScreenPoint method of your camera in the scene instead.

And, if there's any other problem of the plugin, welcome to my clone for solution.

@Nezz Nezz changed the title text out of screen on android Invalid text box position with "Screen Space - Camera" May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants