Search in sources :

Example 1 with MainScreen

use of org.shadebob.skineditor.screens.MainScreen in project gdx-skineditor by cobolfoo.

the class SkinEditorGame method create.

@Override
public void create() {
    opt = new OptionalChecker();
    fm = new SystemFonts();
    fm.refreshFonts();
    // 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
    TexturePacker.Settings settings = new TexturePacker.Settings();
    settings.combineSubdirectories = true;
    TexturePacker.process(settings, "resources/raw/", ".", "resources/uiskin");
    batch = new SpriteBatch();
    skin = new Skin();
    atlas = new TextureAtlas(Gdx.files.internal("resources/uiskin.atlas"));
    skin.addRegions(new TextureAtlas(Gdx.files.local("resources/uiskin.atlas")));
    skin.load(Gdx.files.local("resources/uiskin.json"));
    screenMain = new MainScreen(this);
    screenWelcome = new WelcomeScreen(this);
    setScreen(screenWelcome);
}
Also used : WelcomeScreen(org.shadebob.skineditor.screens.WelcomeScreen) FileHandle(com.badlogic.gdx.files.FileHandle) TextureAtlas(com.badlogic.gdx.graphics.g2d.TextureAtlas) Skin(com.badlogic.gdx.scenes.scene2d.ui.Skin) TexturePacker(com.badlogic.gdx.tools.texturepacker.TexturePacker) SpriteBatch(com.badlogic.gdx.graphics.g2d.SpriteBatch) MainScreen(org.shadebob.skineditor.screens.MainScreen)

Aggregations

FileHandle (com.badlogic.gdx.files.FileHandle)1 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)1 TextureAtlas (com.badlogic.gdx.graphics.g2d.TextureAtlas)1 Skin (com.badlogic.gdx.scenes.scene2d.ui.Skin)1 TexturePacker (com.badlogic.gdx.tools.texturepacker.TexturePacker)1 MainScreen (org.shadebob.skineditor.screens.MainScreen)1 WelcomeScreen (org.shadebob.skineditor.screens.WelcomeScreen)1