com.ng.gdxutils.model.LoadingBar Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx-utils Show documentation
Show all versions of gdx-utils Show documentation
A java library that used over libGdx game framework.
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