playMaker

Author Topic: Screen To World Point problem  (Read 1616 times)

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Screen To World Point problem
« on: September 13, 2015, 09:51:10 AM »
I want to set a sprite to be in the corner of the screen, regarless of phone's resolution.
I transformed normalized screen's X = 0.1 and Y = 0.1 into World Points and Set Position every frame. However, my sprite is far outside the screen both in editor and on a testing phone after building.
For more test I tried to set normalized screen's X = 0.5 and Y = 0.5 in order to set the sprite exactly in the middle of the screen. However, the result is wrong, the sprite is not in the middle and not even close to it. I also tried getting screen's width and height and halving the results. Then, I transformed the results into world position (without normalizing them). The sprite should've been in the middle of the screen, but again, is not, it is exactly where it was with the previous test.
Am I doing something wrong or it is a bug ?
« Last Edit: September 13, 2015, 09:53:47 AM by VascBogdan »

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Re: Screen To World Point problem
« Reply #1 on: September 14, 2015, 08:25:24 AM »
UP! Anyone have any ideea why is this happening ?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Screen To World Point problem
« Reply #2 on: September 15, 2015, 01:20:34 AM »
Hi,

 Sprites have pivot point, have you checked this and set it to center?

For more predictable results, why not using the new UI System, you'll be laying out the same sprite and it will be a lot easier to setup.


 Bye,

 Jean