πŸ”€TextHandler

Used to print/remove text by symbols

API

/// <summary>
/// Is text change process currenly running
/// </summary>
public bool IsTextChanging;

/// <summary>
/// Text value in Text component
/// </summary>
public string Text;

/// <summary>
/// Interface from what you can get Graphic and convert it to TMP or Text
/// </summary>
public IText TextBridge;

/// <summary>
/// Print/Add text to the end of existing content
/// </summary>
/// <param name="text">what we want to print (add to the end of text)</param>
/// <param name="eachSymbolPrintDelay">delay (typing speed), less value - faster typing</param>
/// <param name="firstSymbolPrintDelay">delay (before first symbol typed)</param>
/// <param name="onCompleteCallback">callback that will be raise on text print complete</param>
public TextHandler PrintText(string text, float eachSymbolPrintDelay = 0f, 
        float firstSymbolPrintDelay = 0f, Action onCompleteCallback = null);

/// <summary>
/// Change text simultaneously
/// </summary>
/// <param name="text">text to set</param>
/// <param name="stopCurrentTextChange">[experimental] you can use false value, but text can behave unexpected</param>
public void SetText(string text, bool stopCurrentTextChange = true);
public bool IsTextEmpty();

/// <summary>
/// Stops current text change
/// </summary>
/// <param name="completeChange">raise text change complete callback</param>
public void StopTextChange(bool completeChange);

/// <param name="leftToRight">true -> text will be removed from left to right per symbol, and vice versa</param>
/// <param name="eachSymbolRemoveDelay">less value -> faster text remove</param>
/// <param name="firstSymbolRemoveDelay">delay (before first symbol removed)</param>
/// <param name="onCompleteCallback">callback that will be raise on text remove complete</param>
public TextHandler RemoveText(float eachSymbolRemoveDelay = 0f, bool leftToRight = true, 
         float firstSymbolRemoveDelay = 0f, Action onCompleteCallback = null);

How to use

See example in: Assets\_Examples\Ready Scripts\TextHandler.scene

Last updated