Working on zooming and scrolling of the image. Want to do a full input chain like I did the raycaster, but I don't know if I want to commit to SFML for my windowing...
This commit is contained in:
25
src/main.rs
25
src/main.rs
@@ -92,21 +92,30 @@ fn main() {
|
||||
if code == Key::Escape {
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
Event::MouseButtonPressed { button, x, y } => {
|
||||
if button == Button::Left {
|
||||
return;
|
||||
|
||||
},
|
||||
Event::MouseWheelScrolled { wheel, delta, x, y } => {
|
||||
|
||||
if delta > 0.0 {
|
||||
println!("{:?}", delta);
|
||||
println!("{:?}", background_sprite.get_scale());
|
||||
background_sprite.set_scale(background_sprite.get_scale()+Vector2f::new(0.1,0.1));
|
||||
} else {
|
||||
println!("{:?}", delta);
|
||||
println!("{:?}", background_sprite.get_scale()+Vector2f::new(-0.1,-0.1));
|
||||
background_sprite.set_scale(background_sprite.get_scale()+Vector2f::new(-0.1,-0.1));
|
||||
}
|
||||
}
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
input.ingest(&event)
|
||||
}
|
||||
|
||||
if input.is_held(Key::W) {}
|
||||
if input.is_held(Key::A) {}
|
||||
if input.is_held(Key::S) {}
|
||||
if input.is_held(Key::D) {}
|
||||
if input.is_mousebutton_held(Button::Left) {
|
||||
|
||||
}
|
||||
|
||||
elapsed_time = timer.elap_time();
|
||||
delta_time = elapsed_time - current_time;
|
||||
|
||||
Reference in New Issue
Block a user