fixed issues with Input API
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user