Hello Guest

Author Topic: Get width of screen/camera  (Read 3834 times)

TwistedSage

  • Newbie
  • *
  • Posts: 15
    • View Profile
Get width of screen/camera
« on: January 08, 2015, 08:42:02 pm »
I’m using tk2dCamera.Instance.ScreenExtents.width to try to know when I placed objects off screen.
But it’s not quite working as expected. Do I need to use something else or are there any gotchas?

Thanks in advance

Odin

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Get width of screen/camera
« Reply #1 on: January 09, 2015, 06:01:41 pm »
.width is the width in world space, but the origin may be different. You should use xMin, xMax, etc. to get the right positions. If you're stuck with how it works, check the tk2dCameraAnchors, they anchor things to the extents of the screen.