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 - bach

Pages: [1]
1
Vector3 world_pos = Camera.main.WorldToScreenPoint (position);
pos.z= 0;
Vector3 ui_pos = UICamera.mainCamera.ScreenToWorldPoint(world_pos);
gameObject.transform.position = uipos;

Thanks for pointing me in the right direction!

My code ended up as below:
  1. Vector3 worldPos = UICamera.mainCamera.WorldToViewportPoint(nguiSprite.transform.position);
  2. Vector3 uiPos = Camera.main.ViewportToWorldPoint(worldPos);
  3. gameObject.transform.position = uiPos;
  4.  


2
I am pretty much looking for the opposite of NGUIMath.OverlayPosition

I want to position a GameObject viewed by World Camera
at the position of the NGUI Widget viewed by UI Camera

I've tried all sort of combinations without much luck:

  1. Vector3 pos = nguiCamera.ViewportToWorldPoint(nguiWidget.transform.localPosition);
  2. pos = Camera.main.WorldToViewportPoint(pos);

thanks

3
NGUI 3 Support / Re: iOS 64bit requirement, best path forward?
« on: March 05, 2015, 05:25:42 PM »
I don't think anything will change at that high level.
Developers using the engine won't have to do anything different.
Let Unity engineers worry about that.

.. if I understood the question right!  :)

4
NGUI 3 Support / Re: Scrolling on a curved shape
« on: August 21, 2014, 05:58:46 PM »
Lay the buttons out in a circle, sort of an invisible wheel.

Then touch drag to rotate the wheel.

5
NGUI 3 Support / Re: Invisible UIButton that can still be clicked
« on: August 21, 2014, 05:49:06 PM »
Thanks guys, you're both right.

In my case i have set the Alpha for the Normal Color to 1 (hex color)
that made it invisible and still picked up the touch. Thanks for the tip

For the pressed State I kept it's Color Alpha to 255
works great thanks again!

6
NGUI 3 Support / Invisible UIButton that can still be clicked
« on: August 21, 2014, 08:09:54 AM »
I need to setup an invisible UIButton that when pressed,
I display a sprite to show that it's been touched.

When I set the Alpha to 0 in Colors > Normal
The click event no longer fires.

Is there a way to have the
Normal Sprite transparent
Pressed Sprite Visible
and still have the Click event firing?

thanks




Pages: [1]