Converts the world coordinates to pixel coordinates
(self, location, offset=(0, 0))
| 858 | draw_traffic_signs(map_surface, yield_font_surface, ts_yield, trigger_color=COLOR_ORANGE_1) |
| 859 | |
| 860 | def world_to_pixel(self, location, offset=(0, 0)): |
| 861 | """Converts the world coordinates to pixel coordinates""" |
| 862 | x = self.scale * self._pixels_per_meter * (location.x - self._world_offset[0]) |
| 863 | y = self.scale * self._pixels_per_meter * (location.y - self._world_offset[1]) |
| 864 | return [int(x - offset[0]), int(y - offset[1])] |
| 865 | |
| 866 | def world_to_pixel_width(self, width): |
| 867 | """Converts the world units to pixel units""" |