Author Topic: Recovering GO Screen Position.  (Read 2294 times)

Abnaxus

  • Guest
Recovering GO Screen Position.
« on: July 11, 2013, 10:30:39 AM »
Hey again,

Here's another prob, but it might look dumb to you since you made NGUI plugin :)

I have a GO with an Anchor on it, and I'd just like to have the position of this GO in ScreenPoint (pixel tho, since you can't get iOS point value).
But since it's under a UIRoot etc, the Camera.WorldToScreenPoint() doesn't work properly (I don't know what do I have to multiply by the ratio).

Do you have any idea how I should get the screen position of my object ?

Thanks in advance.

Cheers,
Abnaxus.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Recovering GO Screen Position.
« Reply #1 on: July 11, 2013, 07:13:18 PM »
Knowing the camera that draws the object's layer, use Camera's WorldToScreenPoint to transform it from transform.position to screen space.