fixed issues with Input API
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Color, Gfx } from "@sdk:gfx";
|
||||
import { Input } from "@sdk:input";
|
||||
import { Pad, Touch } from "@sdk:input";
|
||||
|
||||
declare struct Vec2(x: int, y: int)
|
||||
[
|
||||
@@ -51,8 +51,10 @@ fn frame(): void {
|
||||
}
|
||||
|
||||
// 4. Input Snapshot & Nested Member Access
|
||||
let p = Input.pad();
|
||||
if p.a.down {
|
||||
let pad = Pad.a();
|
||||
let touch = Touch.finger();
|
||||
let is_pressed = pad.down || touch.down;
|
||||
if is_pressed {
|
||||
Gfx.clear(Color.BLUE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user