Cleanup body association for ray polys we discard. Add missed call to update_shapes
[tabakrolletjie.git] / tabakrolletjie / scenes / day.py
index 2a1cc35a18c8c0a12f546d4067c6e7edac7676dc..4176e36774de7dc8544ebd1fd4a4ce6e1e9f2887 100644 (file)
@@ -103,6 +103,9 @@ class DayScene(BaseScene):
             tool = ImageButton(
                 '32', '%s.png' % light_config["type"], name='light',
                 pos=(x, y))
+            font = loader.load_font(FONTS["sans"], size=12)
+            tool_cost = font.render("%d" % light_config["cost"], True, (0, 0, 0))
+            tool._img.blit(tool_cost, (16, 12), None)
             tool.light_config = light_config
             tools.append(tool)
             x += step
@@ -203,6 +206,7 @@ class DayScene(BaseScene):
         angle = math.atan2(distance[1], distance[0])
         # Set light angle to this position
         self._dragging.ray_manager.direction = math.degrees(angle)
+        self._dragging.ray_manager.update_shapes()
         # Hackily update gamestate with new angle
         for light_cfg in gamestate.station["lights"]:
             light_pos = pymunk.Vec2d(light_cfg["position"])