Skip to content

Text on a Spline

Lays a text along a curve you draw in the Scene view. The text can scroll along it, show only inside a window of the curve with letters playing effects as they enter and leave, and travel in and out on command. Every typewriter effect rides the curve with the letters, and every material effect keeps its shape on the bent text.

The demo's Splines showcase: a word running around a circle, and a line scrolling along a wave with its letters fading in and out at the ends

Select the text and press Add Spline on its All In 1 Text Shader component. The text bends onto a default arch across its rect, ready to edit. Remove Spline takes it off again; it cannot be undone, so keep a copy of a curve you spent time on.

The component is also in Add Component under AllIn1TextShader → Spline, and starts with the same arch.

Press Edit Spline. The transform gizmo hides and the curve’s points and handles show in the Scene view, until you press the button again or Escape.

A text on an arch in the Scene view while editing: the curve's points, the selected point in orange with its two tangent handles
In the Scene viewWhat it does
Drag a pointMoves it, and selects it
Drag a handleBends the curve. Handles show on the selected point
ShiftShows where a new point would go
Shift + clickAdds a point there: on the curve if you click on it, otherwise after the selected point
Delete or BackspaceRemoves the selected point. A curve keeps at least two
EscapeStops editing

Every change can be undone. The curve is always drawn with arrows showing its direction, and faintly when the object is not selected.

The spline inspector's Spline, Layout and Movement sections
PropertyWhat it does
ClosedJoins the last point to the first, for a loop
Curve ResolutionHow finely the curve is measured. Raise it if letters bunch up on tight bends
SelectedWhich point is selected, also set by clicking one
AddAdds a point after the last one
Insert After SelectedAdds a point halfway to the next one
Remove SelectedRemoves the selected point
Reset PointsReplaces every point with the default arch
PositionThe selected point’s position, in the text’s local space (pixels for UI text)
CurvatureAuto makes a smooth curve from the neighbouring points. Mirrored keeps the two handles opposite and equal. Broken lets them move apart, for a corner
Tangent In, Tangent OutThe handles, shown when Curvature is not Auto

Dragging a handle on an Auto point switches it to Mirrored.

PropertyWhat it does
Auto FitSpaces the text to cover the whole curve
SpacingStretches or squeezes the text along the curve. 1 keeps its own spacing. Ignored while Auto Fit is on
Baseline OffsetMoves the text off the curve, to one side. Positive is the left of the curve’s direction
Clamp EndsOn an open curve, letters past the ends pile up there instead of disappearing
Rotate With CurveTurns each letter to follow the curve. Off keeps every letter upright

Text with several lines stays stacked, each line along the curve.

PropertyWhat it does
Scroll ModeNone stays at Position. Ping Pong travels back and forth along the free part of the curve. Loop travels the whole curve and wraps around
Scroll SpeedIn the text’s local units per second, so pixels per second for UI text
PositionWhere the text sits along its range, from 0 to 1. Scrub it to place the text

Scrolling runs in play mode. Ping Pong does nothing when the text is as long as the curve or longer, since there is no room to move. Loop wraps the text around even on an open curve.

Turn on Enter Exit Enabled and only a window of the curve shows letters. Letters play entrance effects as they move into the window and exit effects as they move out, so a scrolling text can fade, shrink or spin in at one end and out at the other.

PropertyWhat it does
Visible RangeThe part of the curve where letters show, as a fraction of its length
Enter LengthHow long the entering zone at the start of the window is
Exit LengthHow long the leaving zone at its end is
Use Enter As Exit ConfigPlays the enter effects backwards as the exit, as the typewriter’s hide does with its reveal. Off lets you pick a separate exit preset
Enter Effects, Exit EffectsThe presets, the same ones the typewriter’s Reveal and Hide use. See Typewriter
The Enter / Exit section with the visible range and the enter and exit lengths

The effects are driven by where a letter is in the zone, not by time: a letter halfway through the entering zone is halfway through its entrance. So the preset’s speed, order and per word grouping do not apply here; each letter follows its own position.

The Scene view shows the window as a thick band, with its two zones in a lighter tint. Scrub Position in edit mode to preview it.

Show() moves the text in from outside the window to its Position, and Hide() moves it out through the other side. The window is the enter and exit window when it is on, or the whole curve otherwise. In play mode the inspector has Show and Hide buttons to try it.

The demo's Spline Travel: three lines travel in along their curves, settle, then travel out
PropertyWhat it does
Start HiddenIn play mode, the text starts out of sight and waits for Show()
Travel DirectionForward comes in through the window’s start and leaves through its end. Backward is the reverse
Travel DurationSeconds a Show or Hide takes
Individual Letter TravelEach letter makes its own trip at one shared speed, so letters near the edge arrive first and all of them settle together. Off moves the text as one block
Travel EaseA curve that shapes the motion over time
Drive TypewriterWith a typewriter on the text, Show() also plays its reveal (and starts its loops) and Hide() its hide
Override Typewriter TimingThe travel sets the reveal and hide progress instead of the typewriter’s clock: it starts as the text sets off and ends as it lands. As one block, every letter shares that progress. With Individual Letter Travel, each letter follows its own trip
The Travel settings

Show() while the text is already on its way in does nothing, and while it is hiding it turns around from where it is. Hide() works the same way the other round. ShowImmediate() and HideImmediate() jump to the end with no travel.

In the Events section, On Show Completed fires when a Show lands and On Hide Completed when a Hide has finished and the text is out of sight. From code they are the OnShowCompleted and OnHideCompleted C# events. ShowImmediate() and HideImmediate() fire neither.

A typewriter driven by the spline fires its own events too, see Typewriter.

using AllIn1Assets.AllIn1TextShader;
using UnityEngine;
public class BannerIntro : MonoBehaviour
{
[SerializeField] private AllIn1TextSpline spline;
private void OnEnable()
{
spline.OnShowCompleted += OnShown;
spline.Show();
}
private void OnDisable()
{
spline.OnShowCompleted -= OnShown;
}
private void OnShown()
{
Debug.Log("The title has landed");
}
}

Every setting in the inspector is a property: ScrollMode, ScrollSpeed, Position, Spacing, AutoFit, VisibleStart, VisibleEnd, TravelDuration and so on. IsShown and IsTraveling say where the text is. Points are edited with GetPoint, SetPoint, SetPointPosition, AddPoint, InsertPoint and RemovePoint, in the text’s local space.

  • The spline goes after the motion effects and before the warp. Reveal, loop and hide effects move each letter in the curve’s own frame, and a Warp on the same text bends the whole curved text as one.
  • Characters from another font asset (a fallback font, a bold typeface, a <sprite>) are placed on the curve, but skip the enter and exit effects and move as one block during a letter travel. See Troubleshooting.
  • Auto Fit on a closed curve measures from the first letter to the last, so a space at the end of the text does not count, and the gap where the loop closes comes out tighter than the others. For an even loop, turn Auto Fit off and set Spacing by hand.
  • Clicks and links use the flat text’s layout, not the curve.