To use Aseprite assets in Bevy UI, combine AseAnimation or AseSlice with an ImageNode component (which acts as the render target).
Example: Animation in UI
cmd.spawn((
Button,
ImageNode::default(),
AseAnimation {
aseprite: server.load("player.aseprite"),
animation: Animation::tag("walk-right"),
},
));
Example: Slice in UI
cmd.spawn((
Node {
width: Val::Px(100.),
height: Val::Px(100.),
border: UiRect::all(Val::Px(5.)),
..default()
},
ImageNode::default(),
AseSlice {
name: "ghost_red".into(),
aseprite: server.load("ghost_slices.aseprite"),
},
));