All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ng.gdxutils.model.LoadingBar Maven / Gradle / Ivy

The newest version!
package com.ng.gdxutils.model;

import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;

/**
 * (c) 2016 Abhishek Aryan
 *
 * @author Abhishek Aryan
 * @since 24-07-2016
 *
 */
public class LoadingBar extends Actor {

    Animation animation;
    public TextureRegion reg;
    float stateTime;

    public LoadingBar(Animation animation) {
        this.animation = animation;
        reg = animation.getKeyFrame(0);
    }

    @Override
    public void act(float delta) {
        stateTime += delta;
        reg = animation.getKeyFrame(stateTime);    
    }

    @Override
    public void draw(Batch batch, float parentAlpha) {
        batch.draw(reg, getX(), getY(),getWidth(),getHeight());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy