Class TextModeCRTPreset
A named set of CRT settings describing one kind of monitor, such as a green monochrome terminal or a color PC monitor.
Inherited Members
Namespace: Scylla.TextMode.CRT
Assembly: ScyllaTextMode.CRT.dll
Syntax
[ScyllaCreateAsset("TextMode/TextMode CRT Preset", FileName = "TextMode CRT Preset")]
public sealed class TextModeCRTPreset : ScriptableObject
Remarks
Presets placed in a Resources/CRT/Presets folder are found by
TextModeCRTPresetRegistry. A TextModeCRTDriver copies the
preset's settings when the preset is applied, so editing the driver afterwards never
changes the asset.
Fields
DEFAULT_ORDER
List position of a preset that sets none, which places it after the shipped presets.
Declaration
public const int DEFAULT_ORDER = 1000
Field Value
| Type | Description |
|---|---|
| int |
Properties
Description
Gets the description of the monitor the preset describes.
Declaration
public string Description { get; }
Property Value
| Type | Description |
|---|---|
| string |
DisplayName
Gets the name shown in preset lists: the display name, or the asset name when none is set.
Declaration
public string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Order
Gets the position of the preset in preset lists. Lower numbers come first, and presets with the same number are sorted by display name. The shipped presets use 1 to 11; a new preset defaults to DEFAULT_ORDER, which lists it after them.
Declaration
public int Order { get; }
Property Value
| Type | Description |
|---|---|
| int |
Settings
Gets the preset's settings. Treat them as read-only; copy them with CopyFrom(TextModeCRTSettings) before changing anything.
Declaration
public TextModeCRTSettings Settings { get; }
Property Value
| Type | Description |
|---|---|
| TextModeCRTSettings |
Remarks
This is the asset's own instance, not a copy. A change made to it in Play mode in the Editor stays in the asset after Play mode ends.
Methods
Create(string, string, TextModeCRTSettings, int)
Creates a preset in memory from a set of settings, for example to keep a look tuned at runtime.
Declaration
public static TextModeCRTPreset Create(string displayName, string description, TextModeCRTSettings settings, int order = 1000)
Parameters
| Type | Name | Description |
|---|---|---|
| string | displayName | Name shown in preset lists. Also used as the object name. |
| string | description | Description of the monitor the preset describes. |
| TextModeCRTSettings | settings | The settings to store. They are copied, so later changes to them do not reach the preset. Defaults are used when this is null. |
| int | order | Position in preset lists. Defaults to DEFAULT_ORDER, which lists the preset after the shipped ones. |
Returns
| Type | Description |
|---|---|
| TextModeCRTPreset | The new preset. |
Remarks
The preset is not an asset and is not listed anywhere until it is passed to Register(TextModeCRTPreset). In the Editor it can also be saved as an asset with the asset database, which makes it a preset like any other.
Overwrite(string, TextModeCRTSettings)
Replaces the preset's display name and settings, for example to keep a look tuned at runtime in the preset it came from. The description and the list position stay.
Declaration
public void Overwrite(string displayName, TextModeCRTSettings settings)
Parameters
| Type | Name | Description |
|---|---|---|
| string | displayName | The new display name. Null or blank keeps the current one. |
| TextModeCRTSettings | settings | The settings to store. They are copied, so later changes to them do not reach the preset. |
Remarks
This changes the object in memory. In the Editor, mark the asset dirty and save it with the asset database to keep the change; in a player it lasts until the runtime stops. Call Refresh() afterwards when the name changed, so preset lists sort it into its new place.