Example usage for com.badlogic.gdx.scenes.scene2d.ui Image Image

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Image Image

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui Image Image.

Prototype

public Image(Drawable drawable, Scaling scaling, int align) 

Source Link

Usage

From source file:pl.xesenix.games.effects.screens.SplashScreen.java

License:Open Source License

public void show() {
    Gdx.app.log(XesEffects.LOG, "Showing SplashScreen");
    super.show();

    // preparing actors
    // - background:
    this.bgTexture = new Texture("data/splash_screen.png");
    this.bgTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);

    TextureRegion bgTextureRegion = new TextureRegion(bgTexture, 0, 0, 512, 512);

    TextureRegionDrawable drawableBg = new TextureRegionDrawable(bgTextureRegion);

    this.bgImage = new Image(drawableBg, Scaling.fillX, Align.left | Align.top);
    this.bgImage.setFillParent(true);

    // building stage
    this.stage.clear();
    this.stage.addActor(this.bgImage);

    // show animation
    this.stage.addAction(sequence(fadeOut(0), moveTo(0, Gdx.graphics.getHeight() / 2),
            parallel(fadeIn(1.5f), moveTo(0, 0, 1.5f))));
}