Screen height change

I have set the game to adjust the height to match the players screen. The only problem I face is that the y-position of the objects is not right. For instance:
I have a ball and a scourecounter. I have set the y-position of the scourecounter at position ball.y-360. But if the height of the screen changes, the scorecounter is not at the right place.

I want to create a variable in which the height difference between the normal game height (960px) and the changed game height is stored. Then I can set the y-position of scorecounter at position ball.y-360-variable(HeightChange). But how can I best do this?

Have you tried using ScreenHeight()?

1 Like

Hi you need to figured out how much percentage is 360 of the screen then use something like
ball.Y() - (ScreenHeight()/N) where N is the calculated percentage of the screen height.

1 Like