public class CoreTG extends Game { public Preferences preferences; public Skin skin; public Json reader; public BitmapFont menuFont, speechFont; private static final String FONT_CHARACTERS = "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789][_!$%#@|\\/?-+=()*&.;,{}\"´`'<>~"; @Override public void create () { reader = new Json(); preferences = Gdx.app.getPreferences("tech"); FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/ds_pixel_cyr.ttf")); FreeTypeFontGenerator.FreeTypeFontParameter param = new FreeTypeFontGenerator.FreeTypeFontParameter(); param.size = Gdx.graphics.getHeight() / 21; param.characters = FONT_CHARACTERS; param.color = Color.BLACK; menuFont = generator.generateFont(param); param.size = (Gdx.graphics.getHeight() - 10) / 27; speechFont = generator.generateFont(param); generator.dispose(); skin = new Skin(); TextureAtlas atlas = new TextureAtlas(Gdx.files.internal("texture/pack.atlas")); skin.addRegions(atlas); atlas.dispose(); this.setScreen(new MainMenuScreen(this)); } } 

All the resources I get from this Skin via the getDrawable method are displayed as black rectangles. When I take an unpacked resource, it is displayed beautifully. In another question, I read that this may be due to the dispose () method applied to it somewhere, but I myself never apply it to the skin. This means that either it is automatically called somewhere, or the problem is different. Could you help me?

    1 answer 1

    All figured out. The problem arose due to the fact that I applied dispose () to atlas`y. When adding this line to the dispose () method in the CoreTG class, everything was decided.