Creates a new rank card builder.
new RankCardBuilder()
1const card = new RankCardBuilder()2 .setUsername('kiki')3 .setDisplayName('Kiki')4 .setDiscriminator('1234')5 .setAvatar('...')6 .setCurrentXP(300)7 .setRequiredXP(600)8 .setLevel(2)9 .setRank(5)10 .setStatus('online');1112const pngBuffer = await card.build({13 format: 'png'14});
The grapheme provider of this builder.
the height of this builder.
The options manager of this builder.
The tailwind subset to apply to this builder.
the width of this builder.
Get the style of this builder.
Add component to this builder.
Parameter | Type | Description | Optional |
---|---|---|---|
component | the component to add. |
Adjust the canvas size.
Convert this builder into an image.
Parameter | Type | Description | Optional |
---|---|---|---|
options | the build options. |
Sets the avatar for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
image | The avatar for this rank card. |
Sets the background for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
image | The background for this rank card. |
Sets the current xp for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
xp | The current xp for this rank card. |
Sets the username for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
name | The username for this rank card. |
Sets the fonts to be used for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
fontConfig | The fonts to be used for this rank card. |
Sets the level of this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
level | The level of this rank card. |
Set overlay for this rank card.
Sets the progress calculator for this rank card. The value returned by this calculator defines the width of the progress bar. Valid range is 0-100. Returning a number less than 0 or greater than 100 will be clamped within this range, or invalid values will result in 0% width.
Parameter | Type | Description | Optional |
---|---|---|---|
calc | The progress calculator for this rank card. |
Sets the rank of this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
rank | The rank of this rank card. |
Sets the required xp for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
xp | The required xp for this rank card. |
Sets the status for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
status | RankCardUserStatus | The status for this rank card. |
Set the style of this builder.
Parameter | Type | Description | Optional |
---|---|---|---|
newStyle | CSSProperties | the new style. |
Configures the renderer for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
config | Partial<Partial<{avatar:Partial<{container:Stylable|; image:Stylable|; status:Stylable;}>|; background:Stylable|; container:Stylable|; overlay:Stylable|; progressbar:Partial<{container:Stylable|; thumb:Stylable|; track:Stylable;}>|; statistics:Partial<{container:Stylable|; level:Partial<{container:Stylable|; text:Stylable|; value:Stylable;}>|; rank:Partial<{container:Stylable|; text:Stylable|; value:Stylable;}>|; xp:Partial<{container:Stylable|; text:Stylable|; value:Stylable;}>;}>|; username:Partial<{container:Stylable|; handle:Stylable|; name:Stylable;}>;}>> | The configuration for this rank card. |
Configures the texts for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
config | The configuration for this rank card. |
Sets the handle name for this rank card.
Parameter | Type | Description | Optional |
---|---|---|---|
name | The handle name for this rank card. |
Create a builder from builder template.
Parameter | Type | Optional |
---|---|---|
template |
/docs/canvacord/class/RankCardBuilder