Skip to content

A nonlinear-animation lib for Java. It can be used in various graphic animations like Minecraft GUI , Software UI Animations.

License

Notifications You must be signed in to change notification settings

itscola/AnimationLib

Repository files navigation

AnimationLib

An animation lib for Java. It can be used in various graphic animations.

Demo:

protected Animation displayAnimation = new Animation();
protected Animation closeAnimation = new Animation();

displayAnimation.setMin(0).setMax(150).setFunction(new CubicOutFunction()).setTotalTime(260);
closeAnimation.setMin(150).setMax(0).setFunction(new CubicOutFunction()).setTotalTime(150);

if(!needClose){
    // The update method will return the max value, after the total time.
    Render2DUtils.drawRect(x , y , x1, displayAnimation.update());
    
}else{
    Render2DUtils.drawRect(x , y , x1, closeAnimation.update());
}


if(displayAnimation.isFinish()){
    // displayAnimation is finish.
}


displayAnimation.reset();
protected Animation displayAnimation = new Animation();
protected long time;

displayAnimation.setMin(0).setMax(150).setFunction(new CubicOutFunction()).setTotalTime(260);

//init
this.time = System.currentTimeMillis()


Render2DUtils.drawRect(x , y , x1, closeAnimation.update(System.currentTimeMillis() - this.time));
protected Animation displayAnimation = new Animation();

Render2DUtils.drawRect(x , y , x1, 
displayAnimation.setMin(0).setMax(150).setFunction(new CubicOutFunction()).setTotalTime(260).setLock(true).update()
);
float value = enableAnimation.update();
   if(!enableAnimation.isFinish()){
   yPosition = 16 + value;
}

About

A nonlinear-animation lib for Java. It can be used in various graphic animations like Minecraft GUI , Software UI Animations.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages