Class Text.MultiLine

  • Enclosing class:
    Text

    public static class Text.MultiLine
    extends Text
    Represents multiple lines to add.
    Each new String entry in the constructor adds a line break in the final image.
    • Constructor Detail

      • MultiLine

        public MultiLine​(@NotNull
                         @NotNull java.lang.String... lines)
        Creates a new MultiLine instance with each String being set on a new line in the final image.
        Parameters:
        lines - The text lines to add.
    • Method Detail

      • withPosX

        public Text.MultiLine withPosX​(int posX)
        Sets the relative X (horizontal) position of the text, where 0 is the very left of the image.
        The value can be between 0 and Integer.MAX_VALUE (2147483647)

        An IllegalArgumentException may be thrown in the following case:

        • PosX is less than 0.
        Specified by:
        withPosX in class Text
        Parameters:
        posX - The horizontal position of the text, relative to the image itself.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withPosY

        public Text.MultiLine withPosY​(int posY)
        Sets the relative Y (vertical) position of the text, where 0 is the very top of the image.
        The value can be between 0 and Integer.MAX_VALUE (2147483647)

        An IllegalArgumentException may be thrown in the following case:

        • PosX is less than 0.
        Specified by:
        withPosY in class Text
        Parameters:
        posY - The vertical position of the text, relative to the image itself.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withTextAlignment

        public Text.MultiLine withTextAlignment​(@NotNull
                                                @NotNull Text.TextAlignment textAlignment)
        Sets the text-alignment this text has using the provided TextAlignment value.
        The text-alignment influences how the Text is positioned horizontally when using withPosX(int).
        Specified by:
        withTextAlignment in class Text
        Parameters:
        textAlignment - The Text-alignment to use for this text.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withSize

        public Text.MultiLine withSize​(int size)
        Sets the text size to use.

        An IllegalArgumentException may be thrown in the following case:

        • Size is 0 or less.
        Specified by:
        withSize in class Text
        Parameters:
        size - The size of the text.
        Returns:
        The SingleLine instance. Useful for chaining.
      • withFont

        public Text.MultiLine withFont​(@NotNull
                                       @NotNull java.lang.String font)
        Sets the font to use for the text.
        Whether the provided font is valid and/or usable by the API depends on the Fluxpoint API itself and is nothing that can be checked in this library.

        An IllegalArgumentException may be thrown in the following case:

        • Font is an empty String.
        Specified by:
        withFont in class Text
        Parameters:
        font - The font to use.
        Returns:
        The SingleLine instance. Useful for chaining.
      • withColor

        public Text.MultiLine withColor​(@NotNull
                                        @NotNull ColorObject color)
        Sets the Text color to use.
        Please see the documentation of the ColorObject for possible errors.
        Specified by:
        withColor in class Text
        Parameters:
        color - The Color to use for the Text.
        Returns:
        The SingleLine instance. Useful for chaining.
      • withBackgroundColor

        public Text.MultiLine withBackgroundColor​(@NotNull
                                                  @NotNull ColorObject backgroundColor)
        Sets the background color to use for the Text.
        Please see the documentation of the ColorObject for possible errors.
        Specified by:
        withBackgroundColor in class Text
        Parameters:
        backgroundColor - The color to use for the text-background.
        Returns:
        The MultiLine instance. Useful for chaining.
      • asBold

        public Text.MultiLine asBold​(boolean bold)
        Sets whether the text should be bold or not.
        Specified by:
        asBold in class Text
        Parameters:
        bold - Boolean to set if the text should be bold or not.
        Returns:
        The MultiLine instance. Useful for chaining.
      • asItalic

        public Text.MultiLine asItalic​(boolean italic)
        Sets whether the text should be italic or not.
        Specified by:
        asItalic in class Text
        Parameters:
        italic - Boolean to set if the text should be italic or not.
        Returns:
        The MultiLine instance. Useful for chaining.
      • asUnderline

        public Text.MultiLine asUnderline​(boolean underline)
        Sets whether the text should be underlined or not.
        Specified by:
        asUnderline in class Text
        Parameters:
        underline - Boolean to set if the text should be underlined or not.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withWeight

        public Text.MultiLine withWeight​(int weight)
        Sets the font weight of this text.
        The value can be between 0 and Integer.MAX_VALUE (2147483647) where 0 would essentially hide the text.

        An IllegalArgumentException may be thrown in the following case:

        • Weight is less than 0.
        Specified by:
        withWeight in class Text
        Parameters:
        weight - The font weight to use.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withMaxWidth

        public Text.MultiLine withMaxWidth​(int maxWidth)
        Sets the maximum width the text should take.
        The value can be between 0 and Integer.MAX_VALUE (2147483647) where 0 would essentially hide the text.

        An IllegalArgumentException may be thrown in the following case:

        • MaxWidth is less than 0.
        Specified by:
        withMaxWidth in class Text
        Parameters:
        maxWidth - The maximum width of the text.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withMaxHeight

        public Text.MultiLine withMaxHeight​(int maxHeight)
        Sets the maximum height the text should take.
        The value can be between 0 and Integer.MAX_VALUE (2147483647) where 0 would essentially hide the text.

        An IllegalArgumentException may be thrown in the following case:

        • MaxHeight is less than 0.
        Specified by:
        withMaxHeight in class Text
        Parameters:
        maxHeight - The maximum height of the text.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withOutline

        public Text.MultiLine withOutline​(boolean outline)
        Sets whether the text should have an outline or not.
        Specified by:
        withOutline in class Text
        Parameters:
        outline - Boolean to set if the text should have an outline.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withOutlineWidth

        public Text.MultiLine withOutlineWidth​(int outlineWidth)
        Sets the width of the outline for the text.
        This has no effect if withOutline(false) (default value) is used.

        The value can be between 0 and Integer.MAX_VALUE (2147483647) where 0 would make the text have no outline.

        An IllegalArgumentException may be thrown in the following case:

        • OutlineWidth is less than 0.
        Specified by:
        withOutlineWidth in class Text
        Parameters:
        outlineWidth - The width the outline should have.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withOutlineColor

        public Text.MultiLine withOutlineColor​(@NotNull
                                               @NotNull ColorObject color)
        Sets the outline color to use.
        This has no effect if withOutline(false) (default value) is used.

        Please see the documentation of the ColorObject for possible errors.

        Specified by:
        withOutlineColor in class Text
        Parameters:
        color - The color to use for the outline.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withOutlineBlur

        public Text.MultiLine withOutlineBlur​(int outlineBlur)
        Sets the blur the outline should have.
        This has no effect if withOutline(false) (default value) is used.

        The value can be between 0 and Integer.MAX_VALUE (2147483647) where 0 would make the text have no outline blurring.

        An IllegalArgumentException may be thrown in the following case:

        • OutlineWidth is less than 0.
        Specified by:
        withOutlineBlur in class Text
        Parameters:
        outlineBlur - The strength of the blurring for the outline.
        Returns:
        The MultiLine instance. Useful for chaining.
      • withLineSpacing

        public Text.MultiLine withLineSpacing​(double lineSpacing)
        Sets the spacing between the different lines of text.

        An IllegalArgumentException may be thrown in the following case:

        • LineSpacing is less than 1.
        Parameters:
        lineSpacing - The space each line should have in-between.
        Returns:
        The MultiLine instance. Useful for chaining.