TextAreaAttribute
Attribute to make a string be edited with a height-flexible and scrollable text area.
Read time 4 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
- Inherits from: PropertyAttribute
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, Inherited = true, AllowMultiple = false)]public sealed class TextAreaAttribute : PropertyAttribute
Remarks
You can specify the minimum and maximum lines for the TextArea, and the field will expand according to the size of the text. A scrollbar will appear if the text is bigger than the area available.
Note: The maximum lines refers to the maximum size of the TextArea. There is no maximum to the number of lines entered by the user.

Text Area in Inspector.
Examples
using UnityEngine;public class NewMonoBehaviourScript : MonoBehaviour{ [TextAreaAttribute(2, 10)] public string MyTextArea;}
Fields
Value | Description |
|---|---|
| maxLines | The maximum amount of lines the text area can show before it starts using a scrollbar. |
| minLines | The minimum amount of lines the text area will use. |
Constructors
Constructor | Description |
|---|---|
| TextAreaAttribute() | Attribute to make a string be edited with a height-flexible and scrollable text area. |
| TextAreaAttribute(System.Int32,System.Int32) | Attribute to make a string be edited with a height-flexible and scrollable text area. |