Back to API Reference
Class
MarqueeModifier
Inherits:BaseModifier
Implements:IPhaseModifier
Scrolls the whole text horizontally inside its RectTransform, like a news ticker or a song title wider than its label.
Remarks
Apply whole-text: every line moves together whichever range carries the modifier, and the parameters resolve from the first applied range. The text scrolls while it is wider than its padded rect, or always with
Always, and each cycle rests for Pause at the text's start edge — left for a left-to-right paragraph, right for a right-to-left one. While it scrolls, everything the text renders — glyphs, range decorations, inline objects and every copy of a loop — is clipped at the rect's left and right edges; vertical overflow stays visible. Fade softens those edges, and padding keeps resting text clear of the fade. Clicks and hover reach the moving text and each of its copies. An inline scene object in Existing mode keeps its own hierarchy: it follows the laid-out text alone and the clip does not reach it. The position is a pure function of the phase: one phase unit per second on Clock, or exactly what a driver, tween, Animator or code writes under Manual. A change of the text restarts the cycle. Canvas text only: enabling the modifier on UniTextWorld throws NotSupportedException. A text backed by a document, or one another component already scrolls, does not scroll as a marquee and reports why once per occurrence.public MarqueeMode Mode{ get; set }How the text moves: an endless loop of copies, or back and forth between its ends.
public UnitValue Speed{ get; set }Travel per second, in pixels or em of the component's font size; a negative value runs the other way.
public UnitValue Gap{ get; set }Space between the end of the text and the start of the copy that follows it in Loop: pixels, em, or percent of the padded rect's width; a negative value counts as zero.
public UnitValue Fade{ get; set }Width of the soft fade inside the rect's left and right edges, in pixels or em; zero cuts sharply.
