2D Toolkit Forum

2D Toolkit => Support => Topic started by: jorgar on July 03, 2016, 04:00:45 pm

Title: tk2dCamera WorldToScreenPoint?
Post by: jorgar on July 03, 2016, 04:00:45 pm
Hi, what is the equivalent of Camera.WorldToScreenPoint() with a tk2dCamera? I've reading the documentation but i don't see any similar method.
Title: Re: tk2dCamera WorldToScreenPoint?
Post by: jorgar on July 12, 2016, 12:05:03 pm
Anyone know?  :(

What I'm trying to do is get the Touch.position and translate a gameobject to that position. Touch.position returns screen space but i have to give to gameobject the position in world space values. With a normal camera i would use camera.WorldToScreenPoint but with a tk2dCamera it seems doesn't work.
Title: Re: tk2dCamera WorldToScreenPoint?
Post by: unikronsoftware on July 13, 2016, 10:52:08 pm
tk2dCamera has a Camera component on the same game object, just get the camera component and call WorldToScreenPoint on it.
Title: Re: tk2dCamera WorldToScreenPoint?
Post by: jorgar on July 14, 2016, 01:55:42 am
Thank you for answer! I didn't get the camera component. Now is working, thank you!