| 1 |
--- |
| 2 |
title: Migrate Sprite to use Mesh2d + SpriteMaterial |
| 3 |
pull_requests: [25432] |
| 4 |
--- |
| 5 |
|
| 6 |
The `Sprite` rendering backend was migrated to use the `Mesh2d` and `Material2d` infrastructure. |
| 7 |
|
| 8 |
The `Sprite` component now has a new `alpha_mode` field but is otherwise unchanged. |
| 9 |
It defaults to `Blend` which is what the old backend was using but now you can use `Opaque` or `Mask(f32)` when it makes sense for your use case. |
| 10 |
|
| 11 |
The old backend has not been removed yet since `Text2d` still relies on it but if you were relying on it you should consider moving away from it. |
| 12 |
|
| 13 |
The draw order for `Sprite` that shared the same Z-level might be different in some cases. |
| 14 |
In general, you should always specify a Z-level to any sprite that could overlap but it's possible it worked before but that was not part of the contract. |