// Load spritesheet
animator.load("attack.png").await;
// Creating vec of frames
let frames = vec![
(Rect::new(0., 0., 120., 80.), 0.5),
(Rect::new(120., 0., 120., 80.), 0.1),
(Rect::new(240., 0., 120., 80.), 0.1),
(Rect::new(360., 0., 120., 80.), 0.3),
];
// Add frames to queue
animator.add_frames(frames);
loop {
clear_background(BLACK);
// Updating state
animator.update();
// Draw sprite
animator.draw(200., 200.);
next_frame().await
}
-
Notifications
You must be signed in to change notification settings - Fork 0
YuichiKamishiro/macroquad-animations
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published