Example usage for com.badlogic.gdx.scenes.scene2d.ui SavableSvgSkin SavableSvgSkin

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui SavableSvgSkin SavableSvgSkin

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui SavableSvgSkin SavableSvgSkin.

Prototype

public SavableSvgSkin(String name) 

Source Link

Usage

From source file:de.longri.cachebox3.develop.tools.skin_editor.SkinEditorGame.java

License:Apache License

@Override
public void create() {

    Logger.setCurrentLogLevel(Logger.LOG_LEVEL_TRACE);

    opt = new OptionalChecker();

    fm = new SystemFonts();
    fm.refreshFonts();/*from   w ww . ja v  a  2 s . c  o m*/

    // Create projects folder if not already here
    FileHandle dirProjects = new FileHandle("projects");

    if (dirProjects.isDirectory() == false) {
        dirProjects.mkdirs();
    }

    // Rebuild from raw resources, kind of overkill, might disable it for production
    {//TODO enable ones for create a new uiskin.atlas
        TexturePacker.Settings settings = new TexturePacker.Settings();
        settings.maxHeight = 2048;
        settings.maxWidth = 2048;
        settings.combineSubdirectories = true;
        TexturePacker.process(settings, "skin-editor-src-proj/assets/resources/raw/", ".",
                "skin-editor-src-proj/assets/resources/uiskin");
    }

    batch = new SpriteBatch();

    //        skin = new SavableSvgSkin(null);
    skin = new SavableSvgSkin("UiSkin");

    // add skin editor Texture pack
    skin.addRegions(new TextureAtlas(Gdx.files.classpath("resources/uiskin.atlas")));

    // add VisUi Texture pack
    skin.addRegions(new TextureAtlas(Gdx.files.classpath("resources/visuiskin.atlas")));

    skin.load(Gdx.files.classpath("resources/visuiskin.json"));

    VisUI.load(skin);

    screenMain = new MainScreen(this);
    screenWelcome = new WelcomeScreen(this);
    setScreen(screenWelcome);

}