Last updated
Last updated
Learn how to create custom animations
/*
*
* Arguments:
* @ AmazingExtension - Animation owner
* @ AnimationType - Task type
* @ Boolean - Does animation require hex colors?
* @ String... - Your arguments (Text will be displayed as TabComplete)
* */
AnimationBuilder builder = new AnimationBuilder(this, AnimationType.REPEATING, true, "Color1");
/*
* Creating animation building process
* */
builder.setFramesBuilder((arguments, args) -> {
// Getting main text
String mainText = arguments.getMainText();
// Getting sub text
String subText = arguments.getSubText();
/*
*
* You're also able to get:
* @ fps
* @ DisplayType
* @ duration
* @ BarColor
*
* */
// Getting your animation arguments
String myFirstArgument = args[0];
// Colorizing your text
String colorizedMainText = ColorTranslator.colorize(mainText);
// Returning built animation
List<String> animation = new ArrayList<>();
animation.add(colorizedMainText);
animation.add(subText);
// Return type is List<String>
return animation;
});
/*
* Setting animation's default settings
*
* Arguments:
* @ Main Text - Will be displayed if input text is null
* @ Sub Text - Will be displayed if input sub text is null
* @ Bar Color - Default bar color
* @ Duration - Default animation duration
* @ Fps - Default animation frame rate
*
* */
builder.setComponentArguments(ComponentArguments.create("0", "0", BarColor.WHITE, 10, 20, DisplayType.TITLE));
/*
* Let's register our Animation!
* @ String - AnimationName
* */
builder.register("MY_FIRST_ANIMATION");