Domanda

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.

È stato utile?

Soluzione

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top