Example usage for com.badlogic.gdx.graphics.g2d TextureAtlas createPatch

List of usage examples for com.badlogic.gdx.graphics.g2d TextureAtlas createPatch

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d TextureAtlas createPatch.

Prototype

public NinePatch createPatch(String name) 

Source Link

Document

Returns the first region found with the specified name as a NinePatch .

Usage

From source file:CB_UI_Base.GL_UI.Sprites.java

License:Open Source License

protected static NinePatch createPatch(TextureAtlas atlas, String name) {
    NinePatch tmp = null;/*from  w w  w  .j  a  va 2  s  .  c om*/
    if (atlas != null) {
        tmp = atlas.createPatch(name);
    }
    return tmp;
}

From source file:com.agateau.ui.UiBuilder.java

License:Apache License

private void initImageFromNinePatchName(Image image, TextureAtlas atlas, String name) {
    NinePatch patch = atlas.createPatch(name.substring(0, name.length() - 2));
    image.setDrawable(new NinePatchDrawable(patch));
}

From source file:com.sasluca.lcl.graphics.resources.LCLResourceManager.java

License:Apache License

public void addNinepatchFromAtlas(String name, String path) {
    TextureAtlas atlas = new TextureAtlas(Gdx.files.getFileHandle(path, Files.FileType.Internal));
    m_Resources.put(name, atlas.createPatch(name));
}

From source file:com.sasluca.lcl.graphics.resources.LCLResourceManager.java

License:Apache License

public void addNinepatchesFromAtlas(String path, String... names) {
    TextureAtlas atlas = new TextureAtlas(Gdx.files.getFileHandle(path, Files.FileType.Internal));

    for (String name : names) {
        if (m_Resources.containsKey(name))
            return;
        m_Resources.put(name, atlas.createPatch(name));
    }// w w  w. j  a  v  a  2 s .c o m
}