AmazingTitles Core 2.0
  • ๐Ÿ’กWelcome
  • ๐Ÿ“œPlugin Details
  • ๐ŸงFunctions
    • Plugin Functions
    • Sending Animations
    • Sending Notifications
    • Sending Interactive Messages
    • HEX & Gradient colors
  • ๐ŸงจAnimations
    • NONE
    • PULSING
    • RAINBOW
    • SPLIT
    • WAVES
    • WORDS_SPLIT
    • BOUNCE
    • FADE_IN
    • FADE_IN_WRITER
    • FLASHING
    • FLASHING_SYMBOL_WRAP
    • FROM_BOTH_SIDES
    • FROM_RIGHT
    • FROM_LEFT
  • ๐Ÿ”Integrations
    • CMI Integration
  • ๐ŸŽƒExtensions
    • In Development ...
  • Plugin's API
    • Creating AmazingExtension
    • Creating Custom Animations
    • Creating Custom SubCommand
    • Other API stuff
Powered by GitBook
On this page
  1. Plugin's API

Creating Custom Animations

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");
PreviousCreating AmazingExtensionNextCreating Custom SubCommand

Last updated 1 year ago