# HudAnimation
> A fade envelope for a group of HUD elements (fade in, hold (optionally forever), fade out) built fluently like `AnnouncementBadge`:
`gg.lode.lecternapi.api.ui.HudAnimation`
---
## Signature
```java
public class HudAnimation
```
---
## Notes
```java
api.getPacketComponentManager().show(player, component, new HudAnimation()
.fadeIn(300)
.duration(5000) // total lifetime; 0 = stays until hidden
.fadeOut(500));
```
The whole group animates as one unit, every texture, head, button and text element in
the component shares the envelope, so a mixed card of artwork and labels breathes
together instead of piecewise. With a duration set, the group removes itself when the
envelope ends (the fade-out plays over the final `fadeOut` milliseconds of the
duration); without one it stays until hidden, and `fadeOut` becomes the exit
animation for that hide.
---
## Methods
### fadeIn
```java
public HudAnimation fadeIn(int millis)
```
Milliseconds to fade from invisible to full alpha when shown.
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### fadeOut
```java
public HudAnimation fadeOut(int millis)
```
Milliseconds to fade back out, at the end of `duration` when one is set,
otherwise when the group is hidden.
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### duration
```java
public HudAnimation duration(int millis)
```
Total lifetime in milliseconds, fades included. 0 means "until hidden".
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### scale
```java
public HudAnimation scale(float scale)
```
The group's steady-state scale around its anchor; 1 = authored size.
| Parameter | Type |
|---|---|
| `scale` | `float` |
---
### scaleIn
```java
public HudAnimation scaleIn(int millis)
```
Milliseconds to grow from `scaleFrom` to `scale` when shown. Pairs with
the fade but runs on its own clock, a quick fade with a slow pop reads great.
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### scaleOut
```java
public HudAnimation scaleOut(int millis)
```
Milliseconds to shrink back to `scaleFrom` on exit.
| Parameter | Type |
|---|---|
| `millis` | `int` |
---
### scaleFrom
```java
public HudAnimation scaleFrom(float scale)
```
Where the scale animation starts/ends. 0 grows from nothing; 0.8 is a subtle pop.
| Parameter | Type |
|---|---|
| `scale` | `float` |
---
### getFadeIn
```java
public int getFadeIn()
```
---
### getFadeOut
```java
public int getFadeOut()
```
---
### getDuration
```java
public int getDuration()
```
---
### getScale
```java
public float getScale()
```
---
### getScaleIn
```java
public int getScaleIn()
```
---
### getScaleOut
```java
public int getScaleOut()
```
---
### getScaleFrom
```java
public float getScaleFrom()
```
---