Text is rendered into a Surface and blitted like an image. Buttons check Rect.collidepoint() against mouse clicks. Pause screens freeze gameplay updates while drawing a translucent overlay, and the HUD (health/score/timer) is drawn in fixed screen coordinates every frame.
1-B 2-A 3-A 4-B | 5 anti-aliasing (smooth edges) 6 / (divided by) 7 = if button.rect.collidepoint(event.pos): 8 = draw a full-width background rect in a dark color, draw a foreground rect scaled to width*(current_hp/max_hp) in a bright color on top, then draw a border outline rect around both 9 = re-rendering text every frame is wasted CPU work since the Font.render() call is relatively expensive; cache the Surface and only re-render when the text actually changes | 10 = pygame.SRCALPHA allows the surface to store per-pixel transparency, which is required for a translucent black overlay; without it, the fill color would render fully opaque, completely blacking out the game screen behind the "Paused" text instead of dimly showing it through