2D Toolkit Forum

2D Toolkit => Support => Topic started by: gabriel on May 07, 2015, 05:16:29 pm

Title: ScreenToWorldPoint()
Post by: gabriel on May 07, 2015, 05:16:29 pm
I'm new using 2d Toolkit and I can't seem to find it. myMainCamera.ScreenToWorldPoint() is not valid ... And I must be blind...

I'm trying my make my camera draggable and the use of camera Overrides and ZoomFactor make it tedious to calculate modifications to Screen/World relations.

If ScreenToWorldPoint() is not a valid function on a tk2dCamera, what I'm I missing?
Title: Re: ScreenToWorldPoint()
Post by: gabriel on May 07, 2015, 07:40:47 pm
Nevermind. I found it. :)

myCamera.ScreenCamera.ScreenToWorldPoint()
Title: Re: ScreenToWorldPoint()
Post by: unikronsoftware on May 11, 2015, 12:35:26 am
tk2dCamera simply manipulates a Unity camera, so tk2dCamera.ScreenCamera or tk2dCamera.camera, or just GetComponent<Camera> will do the job.