1
NGUI 3 Support / Re: World to Screen Point
« on: July 31, 2016, 08:03:24 PM »
Thanks Aren!
OK, So I've played around with this but am not exactly sure what "widget.transform.OverlayPosition function" is. Is this "NGUIMath.OverlayPosition"? I assume that is it and found an example on the forums that I've tried working with but am a bit perplexed as to how it works and what exactly it does.
Again, if there are examples of this type of functionality I would be happy to work with those, or if anyone can suggest how to proceed with this I would be very grateful.
Thanks again,
Nathan
OK, So I've played around with this but am not exactly sure what "widget.transform.OverlayPosition function" is. Is this "NGUIMath.OverlayPosition"? I assume that is it and found an example on the forums that I've tried working with but am a bit perplexed as to how it works and what exactly it does.
Again, if there are examples of this type of functionality I would be happy to work with those, or if anyone can suggest how to proceed with this I would be very grateful.
Thanks again,
Nathan
- {
- public Vector3 worldPos;
- public Camera worldCam;
- public Camera uiCam;
- public Transform relativeTo;
- public Transform labelTransform;
- void Update ()
- {
- Vector3 overlay = NGUIMath.WorldToLocalPoint (transform.position, Camera.main, UICamera.mainCamera, labelTransform);
- overlay.z = 0.0f;
- labelTransform.localPosition = overlay;
- }
- // Use this for initialization
- void Start () {
- }
- }
