playMaker

Author Topic: Best way to get half of the screen in World ?  (Read 2437 times)

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Best way to get half of the screen in World ?
« on: January 21, 2015, 10:36:28 AM »
My mini-game is for Android mobiles, and for resolution reasons (not all phones have the same resolution) I need to take half of the screen, and compare it to a world value X. As long as my game is 2D, I need only the X value, and I want to compare it to an object's X value.
As long as I don't have more than one phone, I didn't test to just take an X value and see if it works, so I may ask you. What should I do ?

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Best way to get half of the screen in World ?
« Reply #1 on: January 21, 2015, 10:57:33 AM »
Get Screen size ratio
http://hutonggames.com/playmakerforum/index.php?topic=2162.0

Get/Set Screen Resolution
http://hutonggames.com/playmakerforum/index.php?topic=2968.0

Or just a Get Screen Width action, save as Int variable and then divide by 2?

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Re: Best way to get half of the screen in World ?
« Reply #2 on: January 21, 2015, 11:05:45 AM »
But is this a point ? I don't need a length, I need a point, an X, so I can compare it to another X value.

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Best way to get half of the screen in World ?
« Reply #3 on: January 22, 2015, 06:49:21 AM »
Get screen width, save as INT, divide by 2.
The INT will be a point half way across your screen.

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Re: Best way to get half of the screen in World ?
« Reply #4 on: January 22, 2015, 12:13:06 PM »
I will try it ASAP, after I finish my another state. I will let it know if I solved it or not. Thank you.