I have several objects with different textures for different states, so I use TextureAtlas created with TexturePacker and resize the TextureRegion where I need it. I have to resize, because Iβm not only trying to support both 720p and 1080p, but some of my objects are tiles or cursors that change depending on the width and height of the board, as this can change in my game, whereas the board will always occupy the same percentage of the screen.
With Texture I can simply do this:
texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
However, when I use TextureRegion , there is no way to set a filter. This results in a resize of the TextureRegion as sharp, blocky, and scalloped. It doesn't scale very well, and it looks like it doesn't look like anti-aliasing.
This is rather unpleasant because I am not good at graphics, and now, even when I like what I did, it looks like shit. What am I doing to reproduce the TextureFilter.Linear effect using TextureRegion instead of Texture ?
java scaling game-engine textures libgdx
Mike carpenter
source share