Skip to content

Commit

Permalink
Add comment about tracking mouse position
Browse files Browse the repository at this point in the history
  • Loading branch information
jjant committed Oct 19, 2023
1 parent c25f0e9 commit 6d4a821
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/runty8-editor/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ impl<Game: AppCompat> Controller<Game> {
&Msg::KeyboardEvent(event) => {
self.handle_key_combos(event);
}
// Currently the mouse position is tracked by two things independently:
// - Updated by this subscription here in the controller, stored in `self.mouse_position`
// - Updated by the Game, stored in the controller as well, in `self.pico8.state.mouse_{x,y}`
//
// I haven't found yet a nice way to unify them that plays nicely with both,
// and can be run in the editor or in the runtime by itself.
&Msg::MouseEvent(MouseEvent::Move { x, y }) => {
self.mouse_position = Vec2i::new(x, y);
}
Expand Down

0 comments on commit 6d4a821

Please sign in to comment.