1
NGUI 3 Support / Re: File encrypted or not a database
« on: January 14, 2016, 01:45:42 PM »
Hi ArenMook i'm using both the latest version of unity and tried unity 4.5.5 both give the same error...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Look closer at what you're doing:
Vector3 bVector = new Vector3(banknote.worldCorners[1].x, banknote.worldCorners[1].y, 0);
obj01.transform.position = cam.camera.ScreenToWorldPoint(bVector);
It's already in world coordinates, yet you are converting it from screen to world.
All you needed to do was:
obj01.transform.position = banknote.worldCorners[1];
I don't know what coordinates are needed for readpixels, as well as when it should be used. I've never used this function myself, and it's a Unity question which is why I can't be of much use. From NGUI's side, the coordinates are trivial, and that's what I mentioned -- worldCorners, then WorldToScreenPoint.
Math -- you were doing it -- worldCorners, WorldToScreenPoint. Although whether you were the right corner or not, I'm not sure. [1] is top-left, but only windows coordinates are top-left based. OSX and graphics are both bottom-left based, for example.
The screenshot would be the size of your screen, so in pixels. Same math applies.
Not sure about that. Does ReadPixels even work properly on Android? To take screenshots you typically should be using Application.CaptureScreenshot.
I see no code there that does any capturing. I also don't see what 'camera' is. Which camera is it? It needs to be the camera that draws your UI to begin with. Use ReadPixels afterwards.
UIRect.worldCorners tells you the 4 corners of any widget in world space. Use camera.WorldToScreenSpace to convert them to something usable for yourself. The corner you care about is corner[1] (which is top-left).
GUI.TextField is a completely different beast. NGUI's input field data comes either from the TouchScreenKeyboard, or from Input.inputString, depending on the platform.
If commas don't show up in the log, then that's just what Unity passes to NGUI.