Skip to content

Commit

Permalink
flip rendering updown
Browse files Browse the repository at this point in the history
  • Loading branch information
hzheng40 committed May 3, 2024
1 parent 5dbba85 commit 1b90aea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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
3 changes: 2 additions & 1 deletion 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 @@ -242,6 +242,7 @@ def render(self) -> Optional[np.ndarray]:
)

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

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

0 comments on commit 1b90aea

Please sign in to comment.