Core Concepts
beginner conceptsDigits FX · Core Concepts
Core Concepts
This page covers the main concepts you need to understand when working with Digits FX: the component types, the profile system, visual effects, progress bars, and number formatting.
Component Types
Digits FX provides two main components, both inheriting from the Digits base class:
| Component | Renderer | Best For |
|---|---|---|
| DigitsUI | Canvas / RawImage | HUD elements: scores, health bars, timers, counters |
| Digits3D | MeshRenderer | World-space displays: floating damage numbers, labels, 3D counters |
Both components share the same profile system and API. The only difference is the rendering backend.
The Profile System
A DigitsProfile is a ScriptableObject that stores all visual and behavioral settings for a display. Profiles enable you to:
- Share settings — assign the same profile to multiple displays for consistent styling.
- Per-instance overrides — accessing the
profileproperty (notsharedProfile) automatically clones the profile for safe per-object customization. - Create presets — save profiles as assets to reuse across scenes and projects.
sharedProfile when you want changes to affect all objects using that profile. Use profile when you need per-object customization — it automatically creates a clone on first access.
Transition Effects
When a value changes, each digit can animate independently using one of these transitions:
| Effect | Description |
|---|---|
| Scroll | Digits roll up or down like a mechanical counter |
| Morph | Smooth shape interpolation between digit glyphs |
| Fade | Cross-fade between old and new digit values |
| Flip Vertical | 3D flip around horizontal axis (airport board style) |
| Flip Horizontal | 3D flip around vertical axis |
| Flip Clock | Split-flap mechanical clock animation |
| Pixelate | Pixelation dissolve between values |
| None | Instant value change with no animation |
Each transition supports configurable easing functions (Linear, EaseIn, EaseOut, EaseInOut, Cubic, Bounce, and more) and duration settings.
Visual Effects
Digits FX includes several shader-based visual effects that can be combined:
| Effect | Description |
|---|---|
| Glow | Soft luminous outline around digits |
| Fire | Animated flame effect on digit edges |
| Ice | Frosted crystalline appearance |
| Glitter | Sparkle particles across the display surface |
| Scan Lines | Horizontal scan line overlay (retro/CRT look) |
| Glitch | Random displacement and color separation (cyberpunk) |
| Bevel | Raised 3D appearance for digits |
| Shadow | Drop shadow beneath digits for depth |
| Outline | Solid outline around each digit for readability |
Progress Bars
Every Digits component includes a built-in progress bar that can be displayed alongside or instead of numeric values.
| Layout | Description |
|---|---|
| Horizontal | Standard left-to-right fill bar |
| Vertical | Bottom-to-top fill bar |
| Circular | Radial fill (ring/arc) around a center point |
Enable the Damage Indicator option to show a trailing segment that visualizes recent value decreases — commonly used for health bars in games.
Format Strings
The formatString property in the profile controls how numbers are rendered. Digits FX uses a custom formatting engine (not C#'s ToString) for zero-allocation performance.
| Format | Input | Output |
|---|---|---|
"0.00" | 123.456 | 123.45 |
"0,000" | 1234 | 1,234 |
"'SCORE: '00000" | 1234 | SCORE: 01234 |
"HH:MM:SS" | 5025 | 01:23:45 |
"0.0%" | 0.5 | 50.0% |
"0.0K" | 1500 | 1.5K |
"#.##B" | 5400000000 | 5.4B |
"0.00T" | 1230000000000 | 1.23T |
Scale suffix tokens divide the value by a fixed amount and append the suffix letter:
| Token | Scale | Suffix |
|---|---|---|
K | Thousands | 103 |
M | Millions | 106 |
B | Billions | 109 |
T | Trillions | 1012 |
Qa | Quadrillions | 1015 |
Qi | Quintillions | 1018 |
"0.0B" for billions, not "0.0b".
"'$'0,000.00" renders as $1,234.56.
Object Pooling
For frequently created and destroyed displays (such as floating damage numbers, ticker entries, hit indicators), use the static pool utilities to avoid runtime allocations. Both pools follow the same lifecycle: warmup, create, release.
Digits3DPool (world space)
- Warmup — call
Digits3DPool.Warmup(count)at scene start to pre-create instances. - Create — use
Digits3DPool.Create(position, rotation)instead ofInstantiate. - Release — call
Digits3DPool.Release(instance)when done, or enableselfDestructOnFadeOutin the profile for automatic return.
DigitsUIPool (screen space)
- Warmup — call
DigitsUIPool.Warmup(count)at scene start. - Create — use
DigitsUIPool.Create(canvasRectTransform, anchoredPosition)to acquire a pooled instance parented to your Canvas. A second overload accepts a profile and a value so the spawn is configured in a single call:DigitsUIPool.Create(canvasRect, anchoredPos, profile, value). - Release — call
DigitsUIPool.Release(instance)when done.
Released instances are parked under a hidden, inactive root in DontDestroyOnLoad and reused on the next Create. The pool restarts the profile-driven lifecycle effects (fade, move/scale, autoplay) on every Create, so recycled instances start each cycle from a clean state without any extra calls.
See the included Demo UI Pool scene for a full example with random transitions, fonts, colors and visual effects per spawn.
Next Steps
- Scripting Support (C#) — full API reference with code examples.
- FAQ — answers to common questions.
Suggest an improvement
Help us improve this documentation page.