package com.lubjam16.epiceggsmash.global;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.assets.AssetDescriptor;
import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.FileHandleResolver;
import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGeneratorLoader;
import com.badlogic.gdx.graphics.g2d.freetype.FreetypeFontLoader;

/**
 * Created by stonek on 1/30/16.
 */
public class Fonts {

    public static BitmapFont menuItem;
    public static BitmapFont menuItemSelected;
    public static BitmapFont bigFont;
    public static BitmapFont smallFont;
    private static FreeTypeFontGenerator generator;

    public static void init() {

        generator = new FreeTypeFontGenerator(Gdx.files.internal("RockoFLF-Bold.ttf"));

        FreeTypeFontGenerator.FreeTypeFontParameter params = new FreeTypeFontGenerator.FreeTypeFontParameter();

        params.color = Color.NAVY;
        params.minFilter = Texture.TextureFilter.Linear;
        params.magFilter = Texture.TextureFilter.Linear;
        params.size = 35;
        menuItem = generator.generateFont(params);

        params.color = Color.BLACK;
        menuItemSelected = generator.generateFont(params);

        params.color = Color.FIREBRICK;
        params.size = 70;
        bigFont = generator.generateFont(params);

        params.color = Color.NAVY;
        params.size = 25;
        smallFont = generator.generateFont(params);
    }

    public static void clear() {
        smallFont.dispose();
        bigFont.dispose();
        menuItem.dispose();
        menuItemSelected.dispose();
        generator.dispose();
    }
}
