Fullscreen Returning Incorrect Values

I’m trying to calculate the percentage by how many the screen size changes so I can multiply that percentage by every Button’s position to get the correct new position, This is the code.
Say I have a button at 100,100 my screen width and height increase by 10%
I would have to do 100 * 1.1; which would give me the correct new position.

Gdx.graphics.getWidth() shows the new width cause the game is fullscreen it will change size according to someones screen.
If you don’t get my idea, please tell.
Gdx.graphics.getWidth() = 1336 constants.width = 1000

And this is what should be printed out but it’s returning 1.

1336/1000 = 1.336

See if constants.width is an integer. If it is, then change that (to float or double). Dividing an integer by an integer will always return a whole number.

Thank you so much, it worked! :slight_smile: