Hello Guest

Author Topic: ScreenToWorldPoint()  (Read 4393 times)

gabriel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Feudal Feud
ScreenToWorldPoint()
« 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?
« Last Edit: May 07, 2015, 05:22:12 pm by gabriel »

gabriel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Feudal Feud
Re: ScreenToWorldPoint()
« Reply #1 on: May 07, 2015, 07:40:47 pm »
Nevermind. I found it. :)

myCamera.ScreenCamera.ScreenToWorldPoint()

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: ScreenToWorldPoint()
« Reply #2 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.