aboutsummaryrefslogtreecommitdiff
path: root/games/rstnode/rst-client/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'games/rstnode/rst-client/src/state.rs')
-rw-r--r--games/rstnode/rst-client/src/state.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/games/rstnode/rst-client/src/state.rs b/games/rstnode/rst-client/src/state.rs
index d3b5bbcc3d7b..8099cf9add96 100644
--- a/games/rstnode/rst-client/src/state.rs
+++ b/games/rstnode/rst-client/src/state.rs
@@ -55,7 +55,7 @@ impl ClientState {
pub fn viewport(&mut self) -> &mut Viewport {
&mut self.vp
}
-
+
pub fn assets(&self) -> &Assets {
&self.assets
}
@@ -76,6 +76,13 @@ impl EventHandler for ClientState {
Ok(())
}
+ fn mouse_wheel_event(&mut self, ctx: &mut Context, x: f32, y: f32) {
+ self.input.mouse_wheel_event(ctx, x, y);
+ let zoom = self.input.scroll_offset;
+ self.viewport().zoom(zoom);
+
+ }
+
fn draw(&mut self, ctx: &mut Context) -> GameResult<()> {
graphics::clear(ctx, graphics::Color::from_rgb(15, 15, 15));