very strange button size problem

Anything libgdx related goes here!

Re: very strange button size problem

Postby tenfour04 » Mon Aug 19, 2019 2:12 am

UI stuff tends to look kind of ugly if it isn't 1:1 texture pixel to screen pixel (or some whole number multiple like 1:2 or 1:3). So one technique is to make a set of skins at a few resolutions. Use a ScreenViewport for your UI stage. And pick which skin is closest to the screen size.

An alternate solution that is easier for you but might use more memory than necessary is to make a pretty high resolution skin and use MipMapLinearLinear for the minFilter so it will look pretty nice all the time. Then use ExtendViewport for the UI stage and give it desired width and height in the constructor matching what would be a 1:1 scale for this high resolution UI on a 4:3 screen.
Posts: 1233
Joined: Sat Jun 18, 2011 3:24 pm


Return to Libgdx

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 1 guest