Show Posts

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.


Messages - nathanj

Pages: [1]
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
  1. {
  2.  
  3.         public Vector3 worldPos;
  4.         public Camera worldCam;
  5.         public Camera uiCam;
  6.         public Transform relativeTo;
  7.         public Transform labelTransform;
  8.  
  9.         void Update ()
  10.         {
  11.                 Vector3 overlay = NGUIMath.WorldToLocalPoint (transform.position, Camera.main, UICamera.mainCamera, labelTransform);
  12.                 overlay.z = 0.0f;
  13.                 labelTransform.localPosition = overlay;
  14.         }
  15.         // Use this for initialization
  16.         void Start () {
  17.        
  18.         }
  19. }
  20.  

2
NGUI 3 Support / World to Screen Point
« on: July 25, 2016, 06:56:25 PM »
Hi Again

I have another vague, please point me in the right direction please, question.

I'm trying to convert our player's transform position in the game world (3D) to a point on the UI screen (a 2D map that shows the overall terrain). I'm pretty sure that Unity's Camera.WorldToScreenPoint is the way to do this, however, I can not figure out how this would work.

The reason I am posting this here, and not on the Unity forum, is because I would like to also translate the position of specific places in our game to the map as well using icons that can be controlled through NGUI. That and we use NGUI for all of our UI design.

I spent yesterday trying to figure out a solution to this but only found abstract discussions that I honestly have no idea if they even achieve what I'm aiming for. If anyone could point in in the direction of how I would go about achieving this, or aware of any examples, I would be very grateful.

Nathan

3
NGUI 3 Support / Toggling Menu Panels
« on: June 16, 2016, 10:42:30 PM »
Hi

Sorry for the completely elementary question but I've been struggling with this for over a day.

I am struggling with two basic tasks. First, I would like to be able to enable and disable a menu screen with the press of a button. I assume that this has to do with activating and disabling the camera. If there a script in the package for this or should I write my own?

Secondly, I've been trying to switch between menu panels with the selection of an object (going form main menu to options menu). I believe that this would be achieved by attaching the ToggleComponents object to the button being pressed and disabling off the current panel and activating the desired window. The best I have been able to achieve however is visibly hiding the contents of the main window (but I can still click on them).

I get that this is totally basic stuff but I have been unable to find any information about how to achieve this. If you could point my in the right direction I would be most appreciative.

Thank you
Nathan

Pages: [1]