LibGDX: Filtering a scaled TextureRegion

前端 未结 2 659
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-18 00:17

I have several objects with different textures for different states, so I am using a TextureAtlas made with TexturePacker, and resizing the TextureRegion<

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-18 01:00

    If you are packing using gdx-tools then you have to set the option

    Settings settings = new Settings();
        settings.paddingX = 2;
        settings.paddingY = 2;
        settings.minWidth = 32;
        settings.minHeight = 32;
        settings.maxHeight = 1024;
        settings.maxWidth = 1024;
        settings.stripWhitespaceX = true;
        settings.stripWhitespaceY = true;
        settings.filterMag = TextureFilter.Nearest;
        settings.filterMin = TextureFilter.Nearest;
        settings.flattenPaths = true;
    
         TexturePacker2.process(settings, "input directory", "output directory","packName");
    
        System.out.println("PackTextures->main finished.");
    

    or if you are using texture-packer-gui.jar then tick the checkbox for linear(min) and linear(max) and you are good to go...

提交回复
热议问题