API
Assembly: Spark.ScreenTexts Interface: IScreenTextsPlugin Implementation: ScreenTextsPlugin
Interface
public interface IScreenTextsPlugin
{
void DisplayScreenText(string eventName, string text, Vector3 worldPosition);
void DisplayScreenText(string eventName, string text);
List<ScreenTextEntry> GetAllScreenTextEntries();
ScreenTextEntry GetScreenTextEntryByEventName(string eventName);
}Methods
DisplayScreenText (world position)
void DisplayScreenText(string eventName, string text, Vector3 worldPosition)Displays floating text at a world position, converted to screen space. Used for damage numbers, XP gains, and similar feedback.
DisplayScreenText (screen position)
void DisplayScreenText(string eventName, string text)Displays text using the entry's configured screen position and alignment.
GetAllScreenTextEntries
Returns all screen text entries.
GetScreenTextEntryByEventName
Returns the entry configured for a specific event name.
ScreenTextEntry
Extends SparkDatabaseEntry. Configures how floating text appears.
Event Configuration
eventName
string
Event identifier that triggers this text
playerOnlyEvents
bool
Only show for player-involved events
Text Formatting
formatterType
ScreenTextFormatterTypeBase
Custom text formatter
formatterData
ScreenTextFormatterData
Formatter configuration
Visual Configuration
fontAsset
TMP_FontAsset
Custom font (optional)
textColor
Color
Text color
fontSize
float
Font size (12-72)
displayDuration
float
Time visible (0.5-5 seconds)
fadeDuration
float
Fade-out time (0.1-2 seconds)
Animation
animationEnabled
bool
Enable movement/scale animation
yMovementCurve
AnimationCurve
Vertical movement over time
xMovementCurve
AnimationCurve
Horizontal movement over time
scaleCurve
AnimationCurve
Scale over time
Positioning
positionMode
PositionMode
Screen, Target, or Custom
screenAlignment
ScreenAlignment
9-point screen alignment
screenPositionOffset
Vector2
Pixel offset from alignment
followTarget
bool
Track moving targets
worldSpaceOffset
Vector3
Offset from world position
randomizePosition
bool
Add random offset to prevent overlap
randomXPosition
Vector2
Random X range
randomYPosition
Vector2
Random Y range
parentName
string
Name of a custom parent transform
Enums
Methods:
Components
ScreenTextsManager
MonoBehaviour that handles spawning and pooling screen text entities.
container
Transform
Parent for spawned text
screenTextPrefab
ScreenTextEntity
Prefab template
customParents
Transform[]
Named custom parent transforms
initialPoolSize
int
Starting pool size (5-50)
maxPoolSize
int
Maximum pool size (10-200)
defaultTextFormat
string
Fallback format string
Subscribes to SparkEventBase at priority 25. Automatically matches events to entries by event name and spawns formatted text.
Methods:
ScreenTextEntity
MonoBehaviour that renders and animates a single floating text instance.
Handles world-to-screen positioning, animated movement, scale, fade, target following, and visibility culling. Returns to pool on completion.
Custom Formatters
Create custom text formatters by extending ScreenTextFormatterTypeBase:
Usage
Last updated
Was this helpful?
