# AnnouncementBadge
> A Fortnite-style announcement banner: a trapezoid that sweeps open from the centre of the screen, holds, and sweeps shut. Server-side mirror of the Lectern client's badge builder.
`gg.lode.lecternapi.api.ui.AnnouncementBadge`
---
## Signature
```java
public class AnnouncementBadge
```
---
## Notes
All text fields accept plain text, a JSON text component, or MiniMessage-style tags
(`<gold>`, `<gradient:red:blue>`). Blank fields take no space. Showing a new
badge while one is on screen swaps its contents in place without replaying the opening
sweep; the outro plays once no further updates arrive within the hold.
```java
api.getHUDManager().showBadge(player, new AnnouncementBadge()
.title("MYTHIC")
.description("Deal 25% more damage while airborne")
.icon("minecraft:netherite_sword")
.color(0xFFD9A33C)
.background(0.05f)
.backgroundBlur(20f)
.glow(0xFFD9A33C, 0.35f)
.hold(4000));
```
**Deprecated.** The client no longer draws badges. The class stays so the plugins that build one go on compiling while they are moved onto layouts, which can express the same banner and more besides, but nothing is drawn from it any more.
---
## Methods
### title
```java
public AnnouncementBadge title(String title)
```
Headline row.
| Parameter | Type |
|---|---|
| `title` | `String` |
---
### subtitle
```java
public AnnouncementBadge subtitle(String subtitle)
```
Smaller line under the title.
| Parameter | Type |
|---|---|
| `subtitle` | `String` |
---
### description
```java
public AnnouncementBadge description(String description)
```
Body text.
| Parameter | Type |
|---|---|
| `description` | `String` |
---
### caption
```java
public AnnouncementBadge caption(String label, String caption)
```
**Deprecated.** The client no longer draws a caption, the icon moved out of a left-hand column and onto a plate above the banner, and the caption went with the column. Both strings still travel so the fields after them stay aligned, but nothing renders them.
| Parameter | Type |
|---|---|
| `label` | `String` |
| `caption` | `String` |
---
### icon
```java
public AnnouncementBadge icon(String icon)
```
An item id (`minecraft:netherite_sword`) or a texture path ending in .png.
| Parameter | Type |
|---|---|
| `icon` | `String` |
---
### iconSize
```java
public AnnouncementBadge iconSize(int iconSize)
```
Icon edge length in scaled pixels.
| Parameter | Type |
|---|---|
| `iconSize` | `int` |
---
### color
```java
public AnnouncementBadge color(int argb)
```
Accent colour as ARGB; 0 keeps the client default.
| Parameter | Type |
|---|---|
| `argb` | `int` |
---
### persistent
```java
public AnnouncementBadge persistent(boolean persistent)
```
Keeps the badge up until something takes it down, rather than closing after the hold.
For a badge that states an ongoing condition (a held objective, an active buff, a role)
where a banner that vanished after a few seconds would have to be re-sent to stay on
screen. `hold(int)` is ignored while this is set. Take it down with
`hideBadge(player)`, or by showing a non-persistent badge in its place.
| Parameter | Type |
|---|---|
| `persistent` | `boolean` |
---
### hold
```java
public AnnouncementBadge hold(int holdMillis)
```
How long the badge stays fully open, in milliseconds. Ignored when `persistent(boolean)`.
| Parameter | Type |
|---|---|
| `holdMillis` | `int` |
---
### offset
```java
public AnnouncementBadge offset(float x, float y)
```
Offset from the default screen anchor, in scaled pixels.
| Parameter | Type |
|---|---|
| `x` | `float` |
| `y` | `float` |
---
### scale
```java
public AnnouncementBadge scale(float scale)
```
Overall size multiplier.
| Parameter | Type |
|---|---|
| `scale` | `float` |
---
### background
```java
public AnnouncementBadge background(float opacity)
```
A backdrop panel behind the banner, echoing its shape a little larger.
| Parameter | Type | Description |
|---|---|---|
| `opacity` | `float` | 0 for none, 1 for solid. Off by default. |
---
### backgroundColor
```java
public AnnouncementBadge backgroundColor(int rgb)
```
The backdrop's colour as RGB. Black unless set; alpha comes from `background(float)`.
| Parameter | Type |
|---|---|
| `rgb` | `int` |
---
### backgroundBlur
```java
public AnnouncementBadge backgroundBlur(float pixels)
```
Softens the backdrop's edge, in pixels of falloff.
This is a feathered edge, **not** a frosted-glass blur of the scene behind, the only
available blur pass is screen-wide and would blur the whole game rather than the strip
behind the banner.
| Parameter | Type | Description |
|---|---|---|
| `pixels` | `float` | 0 for a hard edge; larger values fade out further |
---
### glow
```java
public AnnouncementBadge glow(int argb, float intensity)
```
A coloured halo behind the trapezoid, echoing its outline outward.
| Parameter | Type | Description |
|---|---|---|
| `argb` | `int` | the glow's colour; 0 falls back to the badge's accent colour |
| `intensity` | `float` | 0 for none; 1 is a strong halo. Off by default. |
---
### plateColor
```java
public AnnouncementBadge plateColor(int argb)
```
ARGB for the plate the icon sits on, above the banner's top edge.
Its own colour rather than the brackets', so a badge can carry a neutral frame with a
coloured plate, or the reverse. Left at 0 it follows `color(int)`.
| Parameter | Type |
|---|---|
| `argb` | `int` |
---
### id
```java
public AnnouncementBadge id(String id)
```
The slot this badge occupies.
Badges with different ids stack on screen together; showing one whose id is already up
updates that badge in place, keeping its position in the stack rather than replaying its
intro. Unset, every badge shares one slot and each replaces the last.
| Parameter | Type |
|---|---|
| `id` | `String` |
---
### subBadge
```java
public AnnouncementBadge subBadge(boolean subBadge)
```
Draws the badge as a sub-badge: a slimmer hatched bar instead of the full banner.
For the secondary line under an announcement (a category, a rarity, a qualifier) where
a second full banner would compete with the first. Same text layout, same timings, same
optional icon; only the shape is quieter.
| Parameter | Type |
|---|---|
| `subBadge` | `boolean` |
---
### align
```java
public AnnouncementBadge align(String alignment)
public AnnouncementBadge align(String horizontal, String vertical)
```
Which way the banner faces: `center`, `left` or `right`.
The side alignments use different artwork (one flat end to sit flush against the screen
edge, the flourish on the inner end only) and are pinned to that edge rather than
centred, so they hold their place at any resolution. Their text reads from the same edge,
and the banner unrolls away from it instead of parting from the middle.
Anchors the badge vertically as well: `top`, `center` or `bottom`.
Same idea as the horizontal alignment, the badge is pinned to that edge and its
`float)` becomes a nudge from it, so it holds its place at any
resolution or aspect ratio rather than drifting as the screen changes shape.
Left unset, a badge keeps the fixed band above centre it has always used.
---
### verticalAlign
```java
public AnnouncementBadge verticalAlign(String vertical)
```
Vertical anchor on its own, for a badge whose horizontal alignment is already set.
| Parameter | Type |
|---|---|
| `vertical` | `String` |
---
### sweepIn
```java
public AnnouncementBadge sweepIn(int millis)
```
How long the banner takes to unroll, in milliseconds. Zero opens it already open.
The hold is counted from the end of this, so a longer sweep lengthens the badge's life
rather than eating into the time it is readable.
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### sweepOut
```java
public AnnouncementBadge sweepOut(int millis)
```
How long the closing sweep takes. Zero cuts it rather than playing an outro.
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### contentFade
```java
public AnnouncementBadge contentFade(int millis)
```
How long the text takes to fade in once the banner has opened. Zero snaps it on.
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### timings
```java
public AnnouncementBadge timings(int sweepIn, int sweepOut, int contentFade)
```
All three animation timings at once.
| Parameter | Type |
|---|---|
| `sweepIn` | `int` |
| `sweepOut` | `int` |
| `contentFade` | `int` |
---
### getTitle
```java
public String getTitle()
```
---
### getSubtitle
```java
public String getSubtitle()
```
---
### getDescription
```java
public String getDescription()
```
---
### getCaptionLabel
```java
public String getCaptionLabel()
```
---
### getCaption
```java
public String getCaption()
```
---
### getPlateColor
```java
public int getPlateColor()
```
---
### getAlignment
```java
public String getAlignment()
```
---
### getVerticalAlignment
```java
public String getVerticalAlignment()
```
---
### getSweepIn
```java
public int getSweepIn()
```
---
### getSweepOut
```java
public int getSweepOut()
```
---
### getContentFade
```java
public int getContentFade()
```
---
### isSubBadge
```java
public boolean isSubBadge()
```
---
### getId
```java
public String getId()
```
---
### getIcon
```java
public String getIcon()
```
---
### getIconSize
```java
public int getIconSize()
```
---
### getColor
```java
public int getColor()
```
---
### getHold
```java
public int getHold()
```
---
### getOffsetX
```java
public float getOffsetX()
```
---
### getOffsetY
```java
public float getOffsetY()
```
---
### getScale
```java
public float getScale()
```
---
### getBackgroundOpacity
```java
public float getBackgroundOpacity()
```
---
### getBackgroundColor
```java
public int getBackgroundColor()
```
---
### getBackgroundBlur
```java
public float getBackgroundBlur()
```
---
### getGlowColor
```java
public int getGlowColor()
```
---
### getGlowIntensity
```java
public float getGlowIntensity()
```
---
### isPersistent
```java
public boolean isPersistent()
```
---