Skip to content

Commit

Permalink
API rework
Browse files Browse the repository at this point in the history
- Options structs with impls of Default allow default arguments
- Some functions renamed
- API is close to the Zig one
  • Loading branch information
soxfox42 committed Jul 9, 2022
1 parent 09414cf commit 4f34521
Show file tree
Hide file tree
Showing 2 changed files with 293 additions and 120 deletions.
17 changes: 14 additions & 3 deletions templates/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,21 @@ pub fn tic() {

cls(13);
unsafe {
spr(1 + T % 60 / 30 * 2, X, Y, &[14], 3, 0, 0, 2, 2);
spr(
1 + T % 60 / 30 * 2,
X,
Y,
SpriteOptions {
w: 2,
h: 2,
transparent: &[14],
scale: 3,
..Default::default()
},
);
}
print!("HELLO WORLD!", 84, 84, 15, false, 1, false);
print!("HELLO WORLD!", 84, 84, PrintOptions::default());

unsafe {
T += 1;
}
Expand Down
Loading

0 comments on commit 4f34521

Please sign in to comment.