Libgdx Pixelated GUI Effect

In LibGDX, I'm currently trying to achieve the effect of a pixel graphical interface, that is, the buttons are pixelated like an 8-bit theme.

When I create my GUI elements, such as TextButton, I use small images like 34x16pixels, but I do them with higher resolution, for example 1920x1080. What is the best way to make such a small, high resolution image?

My thoughts were to use stage.setViewport(WIDTH,HEIGHT)and set the width and height to a reduced resolution, so gui elements would not be so big. This works, however, when adding items, everything goes wrong.enter image description here

This scene / table of mine currently uses reduced resolution. I add widgets to the table as follows:

    table.add(playButton);
    table.row();
    table.add(title);

, , table.row() , , . , ? , , table.add().pad(), , .

.

+4
2

Ninepatch

. , , . .

libgdx.


, ( ) . .

, .

+1

, . , , . Nearest. :

yourTexture.setFilter(TextureFilter.Nearest, TextureFilter.Nearest);

yourTexture - , . texturePacker, . .pack, .

+1

Source: https://habr.com/ru/post/1534926/


All Articles