1786011156
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -16,22 +16,7 @@ fn main() {
|
||||
|
||||
let mut trekstor = Trekstor::new(60, app_state);
|
||||
|
||||
trekstor.update(|ctx, state| {
|
||||
if ctx.input.is_just_released(KeyCode::BTN_TOUCH) {
|
||||
println!("Released {}x{}", ctx.input.x, ctx.input.y);
|
||||
state.x = ctx.input.x;
|
||||
state.y = ctx.input.y;
|
||||
}
|
||||
|
||||
ctx.screen.clear((0, 0, 0, 255).into()).ok();
|
||||
|
||||
Rectangle::new(Point::new(state.x - 5, state.y - 5), Size::new(10, 10))
|
||||
.into_styled(PrimitiveStyle::with_fill((255, 0, 0, 255).into()))
|
||||
.draw(&mut ctx.screen)
|
||||
.ok();
|
||||
|
||||
true
|
||||
});
|
||||
trekstor.update();
|
||||
|
||||
// let red = (255, 0, 0, 255);
|
||||
// let green = (0, 255, 0, 255);
|
||||
|
||||
Reference in New Issue
Block a user