Package me.totalfreedom.display
Class TitleDisplay.TitleBuilder
java.lang.Object
me.totalfreedom.display.TitleDisplay.TitleBuilder
- Enclosing class:
- TitleDisplay
A builder class for
Titles.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.title.Titlebuild()Builds theTitlewith the given parameters.setDisplayDuration(Duration duration) Sets the display duration of theTitle.Sets the fade in time of theTitle.setFadeOut(Duration duration) Sets the fade out time of theTitle.setMainTitle(String title) Sets the main title of theTitle.setMainTitle(String title, net.kyori.adventure.text.format.TextColor titleColor) Sets the main title of theTitle.setMainTitle(net.kyori.adventure.text.Component mainTitle) Sets the main title of theTitle.setSubTitle(String title) Sets the subtitle of theTitle.setSubTitle(String title, net.kyori.adventure.text.format.TextColor titleColor) Sets the subtitle of theTitle.setSubTitle(net.kyori.adventure.text.Component subTitle) Sets the subtitle of theTitle.
-
Constructor Details
-
TitleBuilder
public TitleBuilder()Creates a newTitleDisplay.TitleBuilderwith default values. The default values are:- Empty main title
- Empty subtitle
- Default fade in time
- Default fade out time
- Default display duration
- See Also:
-
Title.DEFAULT_TIMES
-
-
Method Details
-
setMainTitle
Sets the main title of theTitle.- Parameters:
title- The main title of theTitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setMainTitle
public TitleDisplay.TitleBuilder setMainTitle(String title, net.kyori.adventure.text.format.TextColor titleColor) Sets the main title of theTitle.- Parameters:
title- The main title of theTitle.titleColor- The color of the main title.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setMainTitle
Sets the main title of theTitle.- Parameters:
mainTitle- The main title of theTitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setSubTitle
Sets the subtitle of theTitle.- Parameters:
title- The subtitle of theTitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setSubTitle
public TitleDisplay.TitleBuilder setSubTitle(String title, net.kyori.adventure.text.format.TextColor titleColor) Sets the subtitle of theTitle.- Parameters:
title- The subtitle of theTitle.titleColor- The color of the subtitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setSubTitle
Sets the subtitle of theTitle.- Parameters:
subTitle- The subtitle of theTitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setFadeIn
Sets the fade in time of theTitle.- Parameters:
duration- The fade in time of theTitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setFadeOut
Sets the fade out time of theTitle.- Parameters:
duration- The fade out time of theTitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
setDisplayDuration
Sets the display duration of theTitle.- Parameters:
duration- The display duration of theTitle.- Returns:
- The
TitleDisplay.TitleBuilderinstance.
-
build
public net.kyori.adventure.title.Title build()Builds theTitlewith the given parameters.- Returns:
- The built
Title.
-