A builtin builder to create rank cards.
RankCardBuilder
class to create rank cards with ease. The RankCardBuilder
class offers a lot of helper methods to customize the rank card to your liking.
Font
and RankCardBuilder
classes from the canvacord module.
Geist
(by Vercel). This font can be loaded with the Font.loadDefault()
method:
Font.loadDefault()
method and utilize Font.fromFile
or Font.fromBuffer
method to load the font from a file or buffer respectively.
TTF
, OTF
and WOFF
font formats are
supported.RankCardBuilder
instance. This is a builder class exported by canvacord to specifically create rank cards. It offers a lot of helper methods to customize the rank card to your liking.
The following is an example of a rank card builder with common properties set:
setTextStyles
method is used to customize the text styles for different elements in a rank card or leaderboard. This method allows for the modification of default labels for level, experience points (XP), and rank display.
setStyles
method can be used to customize the colors of different elements in a rank card or leaderboard. This method allows for the modification of the background, progress bar, and text colors, etc. The style object is a key-value pair of the style name and the value to be set.
The style behaves similar to css properties.
setProgressCalculator
method. The progress calculator is a function that returns a number between 0 and 100, representing the progress percentage.
twemoji
provider by default. You can override this by using the setGraphemeProvider
method. The setGraphemeProvider
method accepts a GraphemeProvider
enum value.