android - Change image height with delay animation -


i'm using libgdx engine in game , started use tween animation:

i have in game small 'custom' progress bar. 1 image empty progress bar , second full one, booths have same width , height.what update setting position of full same empty, , when want display progress use:

private image fullprogress;  //its libgdx image type //i have set process      float originalheight  = progressempty.getheight();     howmuchprogress = originalheight * process;      fullprogress.setheight(howmuchprogress);     

any ideas how can make change height delay animation, can see few seconds? better use tween engine?

given code example, delay should calculated in process.

if need visualize delay debugging purposes (for example, faking assetmanager's loading progress), suggest this:

private static final float loading_min_time= 2.0f; // delay amount in seconds private float loadingtimer;  @override public void render(float delta) {      // ...      loadingtimer += delta;     float loadingtimerscaled = loadingtimer / loading_min_time;     if (loadingtimerscaled >= 1.0f) {         loadingtimerscaled = 1.0f;     }     process = math.min(process, loadingtimerscaled); // use slow(fake) value. } 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -