playMaker

Author Topic: Finding the screen size, edges in stationary cam game  (Read 2023 times)

ptrlo

  • Playmaker Newbie
  • *
  • Posts: 31
Finding the screen size, edges in stationary cam game
« on: October 20, 2014, 09:40:07 PM »
So I just watched the tutorial on getting screen to world points etc, but what I still wonder: say you have a stationary camera game and things spawn on the screen on many different devices (iOS, Android). How do you make sure all the code is relative to what is actually visible for the player? Or if you want to spawn something coming in at the edge of the screen, how do you know where exactly it is?


Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3998
  • Official Playmaker Support
    • LinkedIn
Re: Finding the screen size, edges in stationary cam game
« Reply #1 on: October 20, 2014, 11:11:29 PM »
You can use Screen To World Point:
https://hutonggames.fogbugz.com/default.asp?W570

Use normalized screen coordinates. E.g., Screen X of 1 would be the right side of the screen.

Alternatively use spawn points that are far enough offscreen for any device/aspect ratio. This might make it easier to balance gameplay, since spawn points wouldn't change across devices...