Skip to content
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

flip rendering updown #130

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions f1tenth_gym/envs/rendering/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ def render(self, text: str, display: pygame.Surface) -> None:
text : str
text to be displayed
display : pygame.Surface
display surface
display surface
"""
self.text = self.font.render(text, True, (125, 125, 125))
position_tuple = self._position_resolver(self.position, display)
display.blit(self.text, position_tuple)
display.blit(pygame.transform.flip(self.text, False, True), position_tuple)


class Map:
Expand Down
4 changes: 2 additions & 2 deletions f1tenth_gym/envs/rendering/rendering_pygame.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
render_mode : str
rendering mode in ["human", "human_fast", "rgb_array"]
render_fps : int
number of frames per second
number of frames per second
"""
super().__init__()
self.params = params
Expand Down Expand Up @@ -241,7 +241,7 @@ def render(self) -> Optional[np.ndarray]:
text=f"FPS: {self.clock.get_fps():.2f}", display=self.canvas
)

self.window.blit(self.canvas, self.canvas.get_rect())
self.window.blit(pygame.transform.flip(self.canvas, False, True), self.canvas.get_rect())

pygame.event.pump()
pygame.display.update()
Expand Down
Loading