fixed issues with Input API

This commit is contained in:
2026-03-24 13:40:30 +00:00
parent 0a087d51fb
commit 2592b1a1d1
17 changed files with 457 additions and 90 deletions
@@ -0,0 +1,6 @@
pub declare struct Button(
pressed: bool,
released: bool,
down: bool,
hold_frames: bounded
)
@@ -1,25 +1,20 @@
pub declare struct ButtonState(
pressed: bool,
released: bool,
down: bool,
hold_frames: bounded
)
pub declare contract Pad host {
fn up(): Button;
fn down(): Button;
fn left(): Button;
fn right(): Button;
fn a(): Button;
fn b(): Button;
fn x(): Button;
fn y(): Button;
fn l(): Button;
fn r(): Button;
fn start(): Button;
fn select(): Button;
}
pub declare struct Pad(
up: ButtonState,
down: ButtonState,
left: ButtonState,
right: ButtonState,
a: ButtonState,
b: ButtonState,
x: ButtonState,
y: ButtonState,
l: ButtonState,
r: ButtonState,
start: ButtonState,
select: ButtonState
)
pub declare contract Input host {
fn pad(): Pad;
pub declare contract Touch host {
fn screen_x(): int;
fn screen_y(): int;
fn finger(): Button;
}