Hello Guest

Author Topic: tk2dCamera WorldToScreenPoint?  (Read 3889 times)

jorgar

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
tk2dCamera WorldToScreenPoint?
« 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.

jorgar

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: tk2dCamera WorldToScreenPoint?
« Reply #1 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.
« Last Edit: July 12, 2016, 12:32:51 pm by jorgar »

unikronsoftware

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

jorgar

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: tk2dCamera WorldToScreenPoint?
« Reply #3 on: July 14, 2016, 01:55:42 am »
Thank you for answer! I didn't get the camera component. Now is working, thank you!