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.

Était-ce utile?

La 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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top