-
Notifications
You must be signed in to change notification settings - Fork 3
14 zoom in/out and move the camera #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Tobias Windisch <[email protected]>
Signed-off-by: Tobias Windisch <[email protected]>
windisch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I just have some comments we could also discuss synchronically for future refactorings.
| o.register(self.env) | ||
|
|
||
| def _draw(self, screen, actions=None): | ||
| def _draw(self, actions=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved more stuff into the Viewpoint class. Maybe - after the refactoring - all pygame specific things can happen inside Viewpoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't put everything in the Viewpoint class. But the visualization.py is supposed to contain every pygame specific thing in the future.
| if pygame.key.get_pressed()[pygame.K_RIGHT]: | ||
| self._view.x -= 10 | ||
|
|
||
| for event in pygame.event.get(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HSMarieK: I moved that piece to here as well - I think we could collect all sorts of user input here - what do you think?
| self.paper = pygame.Surface(size) | ||
|
|
||
|
|
||
| self.screen = pygame.display.set_mode((1280, 720)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the screen an instance variable of the viewpoint. That way, a lot of things happen inside the viewpoint solely.
Signed-off-by: Tobias Windisch <[email protected]>
HSMarieK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good so far.
Signed-off-by: Tobias Windisch <[email protected]>
windisch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I added a tiny beautification and will merge this now - thanks a lot!
Added zoom in visualisation via +/- on the keyboard.
Added camera movement via arrow keys.
Added option to set initial zoom on "line.run()".