Question

I was wondering if there is a way to get the actual size of an actor in LibGDX.

For example when i resize the window all actors sizes on the screen is different but when i do getWidth() for example it seems like it still returns the original width of the actor but i want the width that it have on the screen.

Was it helpful?

Solution

Came up with an alternative solution to save the windows normal size and then divide the new size with new normal size to get a ratio between the two and use this to calculate the actors screen size.

Something like this:

ratio = oldWindowSize/newWindowSize
actorDisplaySize = actorOldSize/ratio
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top