Class CustomPaint
- java.lang.Object
-
- net.eternalclient.api.utilities.paint.CustomPaint
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CustomPaint.State
-
Constructor Summary
Constructors Constructor Description CustomPaint()
CustomPaint(PaintInfo paintInfo, PaintLocations location, java.awt.Color[] fontColors, java.lang.String fontName, java.awt.Color[] textBackgroundColors, java.awt.Color[] textBackgroundBorderColors, int borderThickness, boolean singleBackground, int spaceBetweenFields, int horizontalPadding, int verticalPadding)
Constructor to create the paint, arguments passed define how the paint will appear.CustomPaint(PaintLocations location)
CustomPaint(PaintLocations location, PaintInfo info)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getPaintInfo()
java.lang.String
getRuntimeString()
Returns the time that the current script has ran for.static java.awt.Color
makeTransparentColor(java.awt.Color baseColor, int transparency)
Returns the base color with the applied transparency.void
paint(java.awt.Graphics graphics)
void
paint(java.awt.Graphics graphics, boolean forceRepaint)
CustomPaint
setBackgroundColors(java.awt.Color... backgroundColors)
CustomPaint
setBorderColors(java.awt.Color... borderColors)
CustomPaint
setBorderThickness(int thickness)
CustomPaint
setFont(java.lang.String fontName)
CustomPaint
setFontColors(java.awt.Color... fontColors)
CustomPaint
setHorizontalPadding(int horizontalPadding)
CustomPaint
setInfoSupplier(java.util.function.Supplier<java.lang.String[]> infoSupplier)
CustomPaint
setPaintInfo(PaintInfo paintInfo)
CustomPaint
setPaintLocation(PaintLocations location)
CustomPaint
setSingleBackground(boolean singleBackground)
CustomPaint
setSpaceBetweenFields(int pixels)
CustomPaint
setVerticalPadding(int verticalPadding)
-
-
-
Constructor Detail
-
CustomPaint
public CustomPaint(PaintInfo paintInfo, PaintLocations location, java.awt.Color[] fontColors, java.lang.String fontName, java.awt.Color[] textBackgroundColors, java.awt.Color[] textBackgroundBorderColors, int borderThickness, boolean singleBackground, int spaceBetweenFields, int horizontalPadding, int verticalPadding)
Constructor to create the paint, arguments passed define how the paint will appear.- Parameters:
paintInfo
- The paintInfo object you created, usually this will be the script class that extends PaintInfo. This object allows us to update the paint info for things like script runtime, exp/hr, etc.location
- The location on the screen in which the paint is to be placed, from the enum defined above.fontColors
- Array of Color which represents the font colors to use. If the array is longer than the number of Strings in the info array it will be shortened. If it is shorter the last element of the array will be copied until the array is the same length as the number of Strings in the info array.fontName
- Font name to use to print the text, as a String. This name is checked, and will be replaced if it is unavailable.textBackgroundColors
- Array of Color which represents the background colors to use. Backgrounds will be drawn behind the text in the paint. If you do not want a background, make the Color completely transparent. If the array is longer than the number of Strings in the info array it will be shortened. If it is shorter the last element of the array will be copied until the array is the same length as the number of Strings in the info array.textBackgroundBorderColors
- Array of Color which represents the border colors to use. Borders will be drawn around where the background of the text is on the paint. If you do not want a background, make the Color completely transparent. If the array is longer than the number of Strings in the info array it will be shortened. If it is shorter the last element of the array will be copied until the array is the same length as the number of Strings in the info array.borderThickness
- Thickness of the border to draw. If you do not want a border, make the border thickness 0.singleBackground
- A boolean, true if you want one background behind all text, false if you want backgrounds drawn individually.spaceBetweenFields
- The space in pixels to place between the painted Strings. If using multiple backgrounds the space accounts for the backgrounds, and will be the space between where the backgrounds end.horizontalPadding
- Padding to add horizontally to the printed Strings, measured in pixels. Padding is whitespace, and will create space between the text and edge of backgroundverticalPadding
- Padding to add vertically to the printed Strings, measured in pixels. Padding is whitespace, and will create space between the text and edge of background
-
CustomPaint
public CustomPaint(PaintLocations location, PaintInfo info)
-
CustomPaint
public CustomPaint(PaintLocations location)
-
CustomPaint
public CustomPaint()
-
-
Method Detail
-
makeTransparentColor
public static java.awt.Color makeTransparentColor(java.awt.Color baseColor, int transparency)
Returns the base color with the applied transparency.- Parameters:
baseColor
- Color to make transparent.transparency
- How transparent to make the color, 100 is completely transparent, 0 is completely opaque.- Returns:
- Base color with the applied transparency.
-
setFont
public CustomPaint setFont(java.lang.String fontName)
-
setBorderThickness
public CustomPaint setBorderThickness(int thickness)
-
setFontColors
public CustomPaint setFontColors(java.awt.Color... fontColors)
-
setHorizontalPadding
public CustomPaint setHorizontalPadding(int horizontalPadding)
-
setVerticalPadding
public CustomPaint setVerticalPadding(int verticalPadding)
-
setSingleBackground
public CustomPaint setSingleBackground(boolean singleBackground)
-
setBackgroundColors
public CustomPaint setBackgroundColors(java.awt.Color... backgroundColors)
-
setBorderColors
public CustomPaint setBorderColors(java.awt.Color... borderColors)
-
setSpaceBetweenFields
public CustomPaint setSpaceBetweenFields(int pixels)
-
setPaintLocation
public CustomPaint setPaintLocation(PaintLocations location)
-
setInfoSupplier
public CustomPaint setInfoSupplier(java.util.function.Supplier<java.lang.String[]> infoSupplier)
-
paint
public void paint(java.awt.Graphics graphics)
-
paint
public void paint(java.awt.Graphics graphics, boolean forceRepaint)
-
getRuntimeString
public java.lang.String getRuntimeString()
Returns the time that the current script has ran for. Based off of the start time created when the script starts. Could use the method in the script, but wanted to avoid passing a script object.- Returns:
- The current runtime of the script as a String.
-
getPaintInfo
public java.lang.String[] getPaintInfo()
- Specified by:
getPaintInfo
in interfacePaintInfo
-
setPaintInfo
public CustomPaint setPaintInfo(PaintInfo paintInfo)
-
-