Example usage for com.badlogic.gdx.graphics.g2d NinePatch setColor

List of usage examples for com.badlogic.gdx.graphics.g2d NinePatch setColor

Introduction

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

Prototype

public void setColor(Color color) 

Source Link

Document

Copy given color.

Usage

From source file:CB_UI_Base.GL_UI.Sprites.java

License:Open Source License

protected static NinePatch setNightColorMatrixPatch(String name, TextureAtlas atlas) {
    NinePatch tmp = null;
    tmp = createPatch(atlas, name);//ww  w. ja v  a2 s.co m
    if (tmp == null)
        return null;

    Color colorOverlay = new Color(0.5f, 0.4f, 0.4f, 1f);
    tmp.setColor(colorOverlay);

    return tmp;
}

From source file:net.mwplay.cocostudio.ui.CocoStudioUIEditor.java

License:Apache License

public Drawable findDrawable(ObjectData option, String name) {

    if (option.isScale9Enable()) {// ??
        TextureRegion textureRegion = findTextureRegion(option, name);
        NinePatch np = new NinePatch(textureRegion, option.getScale9OriginX(),
                textureRegion.getRegionWidth() - option.getScale9Width() - option.getScale9OriginX(),
                option.getScale9OriginY(),
                textureRegion.getRegionHeight() - option.getScale9Height() - option.getScale9OriginY());

        np.setColor(getColor(option.getCColor(), option.getAlpha()));
        return new NinePatchDrawable(np);
    }// w  w w .  ja  va2s. c o  m

    TextureRegion tr = findTextureRegion(option, name);

    if (tr == null) {
        return null;
    }

    return new TextureRegionDrawable(tr);
}