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

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

Introduction

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

Prototype

public void setDimensions(float width, float height) 

Source Link

Document

Sets the width and height in world units

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 av a  2s  .c  o m
    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);
}