Example usage for com.badlogic.gdx.graphics.g3d.decals Decal setColor

List of usage examples for com.badlogic.gdx.graphics.g3d.decals Decal setColor

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d.decals Decal setColor.

Prototype

public void setColor(float r, float g, float b, float a) 

Source Link

Document

Sets the color of all four vertices to the specified color

Usage

From source file:com.github.fauu.helix.displayable.CharacterDisplayable.java

License:Open Source License

public CharacterDisplayable(IntVector3 logicalPosition, String animationSetName, TextureRegion shadowTexture) {
    super(logicalPosition.toVector3().add(DEFAULT_DISPLACEMENT));

    animations = new AnimationSet(animationSetName);

    AnimatedDecal decal = AnimatedDecal.newAnimatedDecal(DEFAULT_DIMENSIONS.x, DEFAULT_DIMENSIONS.y,
            animations.getDefault(), true);

    decal.setKeepSize(true);/*from ww  w. j a v a  2s.  c  om*/
    decal.setPosition(position);
    decal.rotateX(DEFAULT_ROTATION);

    setMainDecal(decal);

    Decal shadow = new Decal();

    shadow.setPosition(position);
    shadow.translate(DEFAULT_SHADOW_DISPLACEMENT);
    shadow.setDimensions(DEFAULT_SHADOW_DIMENSIONS.x, DEFAULT_SHADOW_DIMENSIONS.y);
    shadow.setColor(1, 1, 1, .35f);
    shadow.setTextureRegion(shadowTexture);
    shadow.setBlending(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

    setShadowDecal(shadow);
}