NoaInformationOverlayCallbacks
The callback settings specified when registering an overlay group.
By passing a class that inherits NoaInformationOverlayCallbacks to NoaInformationOverlay.RegisterGroup, you can customize events related to the overlay display.
Overridable Members
Methods
| Method | Description |
|---|---|
| OnBeforeShow(overlayInfo) | A method executed before the overlay is displayed. Both the argument and the return value are IReadOnlyList<KeyValuePair<string, string>>. When you edit keys and values and return them, the changes are reflected on the overlay display (TextMeshPro rich text tags can be used). |
Properties
| Property | Description |
|---|---|
| AutoRefreshEnabled | Whether to automatically refresh the overlay display. |
Sample Code
The following sample code applies rich text tags via the return value of OnBeforeShow.
using System.Collections.Generic;
#if NOA_DEBUGGER
using NoaDebugger;
#endif
public class ExampleCustomOverlayCallbacks : NoaInformationOverlayCallbacks
{
public override IReadOnlyList<KeyValuePair<string, string>> OnBeforeShow(
IReadOnlyList<KeyValuePair<string, string>> overlayInfo)
{
if (overlayInfo == null || overlayInfo.Count == 0)
{
return overlayInfo;
}
var result = new List<KeyValuePair<string, string>>(overlayInfo.Count);
foreach (var kv in overlayInfo)
{
string styledKey = $"<color=#AAAAAA>{kv.Key}</color>";
string styledValue = $"<color=#00FF00>{kv.Value}</color>";
result.Add(new KeyValuePair<string, string>(styledKey, styledValue));
}
return result;
}
}
