Compare commits

...

3 Commits

Author SHA1 Message Date
royjr
a29ec875de Update exp_button.py 2025-12-21 21:53:05 -05:00
royjr
fd342c2f54 Merge branch 'master' into visual-steering-angle 2025-12-21 21:23:34 -05:00
royjr
1a98736398 steering visual 2025-09-18 17:12:39 -04:00

View File

@@ -50,7 +50,12 @@ class ExpButton(Widget):
texture = self._txt_exp if self._held_or_actual_mode() else self._txt_wheel
rl.draw_circle(center_x, center_y, self._rect.width / 2, self._black_bg)
rl.draw_texture(texture, center_x - texture.width // 2, center_y - texture.height // 2, self._white_color)
src_rect = rl.Rectangle(0.0, 0.0, texture.width, texture.height)
dest_rect = rl.Rectangle(center_x, center_y, texture.width, texture.height)
origin = rl.Vector2(texture.width / 2.0, texture.height / 2.0)
rotation = -ui_state.sm['carState'].steeringAngleDeg
rl.draw_texture_pro(texture, src_rect, dest_rect, origin, rotation, self._white_color)
def _held_or_actual_mode(self):
now = time.monotonic()