문제

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.

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top