Class LineScrollTextBuffer.Builder
Fluent builder for creating and configuring LineScrollTextBuffer instances.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
public sealed class LineScrollTextBuffer.Builder
Remarks
Call CreateBuilder() to obtain a builder instance, chain the desired configuration methods, then call Build() to construct the buffer.
var buffer = LineScrollTextBuffer.CreateBuilder()
.WithCapacity(500)
.WithWindowSize(30)
.WithDisplayMetrics(displayWidth, font, fontSize)
.WithAutoScroll(true)
.Build();
Methods
Build()
Builds the LineScrollTextBuffer.
Declaration
public LineScrollTextBuffer Build()
Returns
| Type | Description |
|---|---|
| LineScrollTextBuffer | The configured buffer. |
WithAutoScroll(bool)
Enables or disables auto-scroll.
Declaration
public LineScrollTextBuffer.Builder WithAutoScroll(bool enabled = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | Whether to enable auto-scroll. |
Returns
| Type | Description |
|---|---|
| LineScrollTextBuffer.Builder | This builder. |
WithCapacity(int)
Sets the buffer capacity (maximum logical lines).
Declaration
public LineScrollTextBuffer.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The capacity. |
Returns
| Type | Description |
|---|---|
| LineScrollTextBuffer.Builder | This builder. |
WithDisplayMetrics(float, TMP_FontAsset, float)
Sets the display metrics for wrap calculation.
Declaration
public LineScrollTextBuffer.Builder WithDisplayMetrics(float displayWidth, TMP_FontAsset font, float fontSize)
Parameters
| Type | Name | Description |
|---|---|---|
| float | displayWidth | The display width in pixels. |
| TMP_FontAsset | font | The TMP font asset. |
| float | fontSize | The font size. |
Returns
| Type | Description |
|---|---|
| LineScrollTextBuffer.Builder | This builder. |
WithEventPublishing(bool)
Enables or disables event publishing.
Declaration
public LineScrollTextBuffer.Builder WithEventPublishing(bool enabled = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | Whether to publish events. |
Returns
| Type | Description |
|---|---|
| LineScrollTextBuffer.Builder | This builder. |
WithWindowSize(int)
Sets the window size (visible lines).
Declaration
public LineScrollTextBuffer.Builder WithWindowSize(int windowSize)
Parameters
| Type | Name | Description |
|---|---|---|
| int | windowSize | The window size. |
Returns
| Type | Description |
|---|---|
| LineScrollTextBuffer.Builder | This builder. |