Class ScrollTextBuffer.Builder
Fluent builder for creating and configuring ScrollTextBuffer instances.
Inherited Members
Namespace: Scylla.Core.Util.UI
Assembly: ScyllaCore.dll
Syntax
public sealed class ScrollTextBuffer.Builder
Remarks
Call CreateBuilder() to obtain a builder instance, chain the desired configuration methods, then call Build() to construct the buffer.
var buffer = ScrollTextBuffer.CreateBuilder()
.WithCapacity(500)
.WithDisplayMetrics(displayWidth, font, fontSize)
.WithAutoScroll(true)
.Build();
Methods
Build()
Builds the ScrollTextBuffer.
Declaration
public ScrollTextBuffer Build()
Returns
| Type | Description |
|---|---|
| ScrollTextBuffer | The configured buffer. |
WithAutoScroll(bool)
Enables or disables auto-scroll.
Declaration
public ScrollTextBuffer.Builder WithAutoScroll(bool enabled = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | Whether to enable auto-scroll. |
Returns
| Type | Description |
|---|---|
| ScrollTextBuffer.Builder | This builder. |
WithCapacity(int)
Sets the buffer capacity (maximum lines).
Declaration
public ScrollTextBuffer.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The capacity. |
Returns
| Type | Description |
|---|---|
| ScrollTextBuffer.Builder | This builder. |
WithDisplayMetrics(float, TMP_FontAsset, float)
Sets the display metrics for height calculation.
Declaration
public ScrollTextBuffer.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 |
|---|---|
| ScrollTextBuffer.Builder | This builder. |
WithEventPublishing(bool)
Enables or disables event publishing.
Declaration
public ScrollTextBuffer.Builder WithEventPublishing(bool enabled = true)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | enabled | Whether to publish events. |
Returns
| Type | Description |
|---|---|
| ScrollTextBuffer.Builder | This builder. |
WithLineHeight(float)
Sets the line height directly.
Declaration
public ScrollTextBuffer.Builder WithLineHeight(float lineHeight)
Parameters
| Type | Name | Description |
|---|---|---|
| float | lineHeight | The line height in pixels. |
Returns
| Type | Description |
|---|---|
| ScrollTextBuffer.Builder | This builder. |