UI Toolkit Kit

Essential game UI components: health bars, damage numbers, tooltips, minimap, screen fader, and timer display.

6 scripts intermediate Starter kit Essential UI for any game

Download ui-toolkit-kit.zip 6 scripts and a README · 21 KB of C# · MIT

What is inside

What it does

  • Health bar with smooth fill, color gradient, and damage flash
  • Floating damage and healing numbers with animations
  • Mouse-following tooltip with auto-positioning and rich text
  • Screen fade-in/fade-out for transitions and cutscenes
  • Render texture minimap with icons and zoom control
  • Versatile timer with countdown, stopwatch, and formatted display

Setup, in order

  1. Import all scripts into your project
  2. Create health bar UI with background and fill images
  3. Attach HealthBarUI and connect to HealthSystem events
  4. Set up tooltip panel with header and body TextMeshPro texts
  5. Create a full-screen Image for ScreenFader transitions
  6. Set up minimap camera and RawImage display for MinimapSystem
  7. Add Timer component for countdown/stopwatch displays
  8. DamagePopup.Create() for floating combat numbers

If something does not work

The health bar does not fill
HealthBarUI drives an Image's fillAmount. Set the fill Image's Image Type to Filled; on a Simple image, fillAmount has no visible effect.
The minimap is black
MinimapSystem shows a RenderTexture from a separate orthographic camera. Assign the same RenderTexture to that camera's Output Texture and to the RawImage, and make sure the minimap camera can see the layers you want.
Tooltips are cut off at the screen edge or sized wrongly
TooltipSystem flips to stay on screen and forces a layout rebuild for its ContentSizeFitter. Give the tooltip panel a ContentSizeFitter set to Preferred Size so it grows with its text.
The kit is called UI Toolkit but uses Canvas
The scripts are built on Unity UI (uGUI Canvas, Image and TextMeshPro), not the UI Toolkit (UXML) framework. Use them in a Canvas-based UI.

Preview

An excerpt of the kit's main types, and the Inspector fields they expose.

InspectorExcerpt

Fields from the kit's preview excerpt; the full kit has more.

Fill Image None (Image)
Color Gradient None (Gradient)
Smooth Speed 5
Excerpt
C#
// HealthBarUI.cs - Smooth animated health bar
public class HealthBarUI : MonoBehaviour
{
    [SerializeField] private Image fillImage;
    [SerializeField] private Gradient colorGradient;
    [SerializeField] private float smoothSpeed = 5f;

    public void SetHealth(float current, float max) { /* smooth fill */ }
}

// TooltipSystem.cs - Mouse-following tooltip
public class TooltipSystem : MonoBehaviour
{
    public static void Show(string header, string body) { /* ... */ }
    public static void Hide() { /* ... */ }
    // Auto-positions to stay on screen
}