mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Various text rendering changes
This commit is contained in:
parent
da3bcf7819
commit
cdc8794c54
@ -18,6 +18,14 @@ Localization
|
|||||||
#LOC_ConformalDecals_gui-aspectratio = Aspect Ratio
|
#LOC_ConformalDecals_gui-aspectratio = Aspect Ratio
|
||||||
#LOC_ConformalDecals_gui-select-flag = Select Flag
|
#LOC_ConformalDecals_gui-select-flag = Select Flag
|
||||||
#LOC_ConformalDecals_gui-reset-flag = Reset Flag
|
#LOC_ConformalDecals_gui-reset-flag = Reset Flag
|
||||||
|
#LOC_ConformalDecals_gui-set-text = Set Text
|
||||||
|
#LOC_ConformalDecals_gui-group-fill = Fill
|
||||||
|
#LOC_ConformalDecals_gui-group-outline = Outline
|
||||||
|
#LOC_ConformalDecals_gui-fill = Fill
|
||||||
|
#LOC_ConformalDecals_gui-set-fill-color = Set Fill Color
|
||||||
|
#LOC_ConformalDecals_gui-outline = Outline
|
||||||
|
#LOC_ConformalDecals_gui-outline-width = Outline Width
|
||||||
|
#LOC_ConformalDecals_gui-set-outline-color = Set Outline Color
|
||||||
|
|
||||||
// PARTS
|
// PARTS
|
||||||
|
|
||||||
|
Binary file not shown.
@ -89,7 +89,7 @@
|
|||||||
<Compile Include="Text/DecalText.cs" />
|
<Compile Include="Text/DecalText.cs" />
|
||||||
<Compile Include="Test/TestLayers.cs" />
|
<Compile Include="Test/TestLayers.cs" />
|
||||||
<Compile Include="Text\DecalTextStyle.cs" />
|
<Compile Include="Text\DecalTextStyle.cs" />
|
||||||
<Compile Include="Text\RenderedText.cs" />
|
<Compile Include="Text\TextRenderOutput.cs" />
|
||||||
<Compile Include="Text\TextRenderJob.cs" />
|
<Compile Include="Text\TextRenderJob.cs" />
|
||||||
<Compile Include="UI/ColorPickerController.cs" />
|
<Compile Include="UI/ColorPickerController.cs" />
|
||||||
<Compile Include="UI/FontMenuController.cs" />
|
<Compile Include="UI/FontMenuController.cs" />
|
||||||
|
@ -1,16 +1,65 @@
|
|||||||
using ConformalDecals.Text;
|
using ConformalDecals.Text;
|
||||||
using ConformalDecals.UI;
|
using ConformalDecals.UI;
|
||||||
|
using ConformalDecals.Util;
|
||||||
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ConformalDecals {
|
namespace ConformalDecals {
|
||||||
public class ModuleConformalText : ModuleConformalDecal {
|
public class ModuleConformalText : ModuleConformalDecal, ISerializationCallbackReceiver {
|
||||||
[KSPField(isPersistant = true)] public string text = "Hello World!";
|
[KSPField(isPersistant = true)] public string text = "Hello World!";
|
||||||
|
[KSPField(isPersistant = true)] public Color fillColor = Color.black;
|
||||||
|
[KSPField(isPersistant = true)] public Color outlineColor = Color.white;
|
||||||
|
|
||||||
|
// serialization-only fields. do not use except in serialization functions
|
||||||
[KSPField(isPersistant = true)] public string fontName = "Calibri SDF";
|
[KSPField(isPersistant = true)] public string fontName = "Calibri SDF";
|
||||||
[KSPField(isPersistant = true)] public int style;
|
[KSPField(isPersistant = true)] public int style;
|
||||||
[KSPField(isPersistant = true)] public bool vertical;
|
[KSPField(isPersistant = true)] public bool vertical;
|
||||||
[KSPField(isPersistant = true)] public Color fillColor = Color.black;
|
[KSPField(isPersistant = true)] public float lineSpacing;
|
||||||
[KSPField(isPersistant = true)] public Color outlineColor = Color.white;
|
[KSPField(isPersistant = true)] public float characterSpacing;
|
||||||
[KSPField(isPersistant = true)] public float outlineWidth;
|
|
||||||
|
// KSP TWEAKABLES
|
||||||
|
|
||||||
|
[KSPEvent(guiName = "#LOC_ConformalDecals_gui-set-text", guiActive = false, guiActiveEditor = true)]
|
||||||
|
public void SetText() {
|
||||||
|
if (_textEntryController == null) {
|
||||||
|
_textEntryController = TextEntryController.Create(text, _font, _style, OnTextUpdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILL
|
||||||
|
|
||||||
|
[KSPField(guiName = "#LOC_ConformalDecals_gui-fill", groupName = "decal-fill", groupDisplayName = "#LOC_ConformalDecals_gui-group-fill",
|
||||||
|
guiActive = false, guiActiveEditor = true, isPersistant = true),
|
||||||
|
UI_Toggle()]
|
||||||
|
public bool fillEnabled = true;
|
||||||
|
|
||||||
|
[KSPEvent(guiName = "#LOC_ConformalDecals_gui-fill-color", groupName = "decal-fill", groupDisplayName = "#LOC_ConformalDecals_gui-group-fill",
|
||||||
|
guiActive = false, guiActiveEditor = true)]
|
||||||
|
public void SetFillColor() {
|
||||||
|
if (_fillColorPickerController == null) {
|
||||||
|
_fillColorPickerController = ColorPickerController.Create(fillColor, OnFillColorUpdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// OUTLINE
|
||||||
|
|
||||||
|
[KSPField(guiName = "#LOC_ConformalDecals_gui-outline", groupName = "decal-outline", groupDisplayName = "#LOC_ConformalDecals_gui-group-outline",
|
||||||
|
guiActive = false, guiActiveEditor = true, isPersistant = true),
|
||||||
|
UI_Toggle()]
|
||||||
|
public bool outlineEnabled;
|
||||||
|
|
||||||
|
[KSPField(guiName = "#LOC_ConformalDecals_gui-outline-width", groupName = "decal-outline", groupDisplayName = "#LOC_ConformalDecals_gui-group-outline",
|
||||||
|
guiActive = false, guiActiveEditor = true, isPersistant = true, guiFormat = "F2"),
|
||||||
|
UI_FloatRange(stepIncrement = 0.05f)]
|
||||||
|
public float outlineWidth = 0.1f;
|
||||||
|
|
||||||
|
[KSPEvent(guiName = "#LOC_ConformalDecals_gui-set-outline-color", groupName = "decal-outline", groupDisplayName = "#LOC_ConformalDecals_gui-group-outline",
|
||||||
|
guiActive = false, guiActiveEditor = true)]
|
||||||
|
public void SetOutlineColor() {
|
||||||
|
if (_outlineColorPickerCOntroller == null) {
|
||||||
|
_outlineColorPickerCOntroller = ColorPickerController.Create(outlineColor, OnOutlineColorUpdate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private DecalTextStyle _style;
|
private DecalTextStyle _style;
|
||||||
private DecalFont _font;
|
private DecalFont _font;
|
||||||
@ -19,13 +68,26 @@ namespace ConformalDecals {
|
|||||||
private ColorPickerController _fillColorPickerController;
|
private ColorPickerController _fillColorPickerController;
|
||||||
private ColorPickerController _outlineColorPickerCOntroller;
|
private ColorPickerController _outlineColorPickerCOntroller;
|
||||||
|
|
||||||
|
public override void OnLoad(ConfigNode node) {
|
||||||
|
base.OnLoad(node);
|
||||||
|
OnAfterDeserialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnSave(ConfigNode node) {
|
||||||
|
OnBeforeSerialize();
|
||||||
|
base.OnSave(node);
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnStart(StartState state) {
|
public override void OnStart(StartState state) {
|
||||||
base.OnStart(state);
|
base.OnStart(state);
|
||||||
|
|
||||||
_font = DecalConfig.GetFont(fontName);
|
_font = DecalConfig.GetFont(fontName);
|
||||||
_style = new DecalTextStyle();
|
_style = new DecalTextStyle();
|
||||||
|
// handle tweakables
|
||||||
|
|
||||||
var decalText = new DecalText("Hello World!", _font, _style);
|
if (HighLogic.LoadedSceneIsEditor) {
|
||||||
|
GameEvents.onEditorPartEvent.Add(OnEditorEvent);
|
||||||
|
}
|
||||||
|
|
||||||
//TextRenderer.Instance.RenderText(decalText, out var texture, out var window);
|
//TextRenderer.Instance.RenderText(decalText, out var texture, out var window);
|
||||||
//materialProperties.AddOrGetTextureProperty("_Decal", true).Texture = texture;
|
//materialProperties.AddOrGetTextureProperty("_Decal", true).Texture = texture;
|
||||||
@ -33,6 +95,35 @@ namespace ConformalDecals {
|
|||||||
UpdateScale();
|
UpdateScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnDestroy() {
|
||||||
|
base.OnDestroy();
|
||||||
|
this.Log("OnDestroy");
|
||||||
|
|
||||||
|
if (HighLogic.LoadedSceneIsEditor) {
|
||||||
|
GameEvents.onEditorPartEvent.Remove(OnEditorEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPartDeleted() {
|
||||||
|
this.Log("OnPartDeleted");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPartSymmetryDeleted() {
|
||||||
|
this.Log("OnPartSymmetryDeleted");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected new void OnEditorEvent(ConstructionEventType eventType, Part eventPart) {
|
||||||
|
if (eventPart != part) return;
|
||||||
|
switch (eventType) {
|
||||||
|
case ConstructionEventType.PartSymmetryDeleted:
|
||||||
|
OnPartSymmetryDeleted();
|
||||||
|
break;
|
||||||
|
case ConstructionEventType.PartDeleted:
|
||||||
|
OnPartDeleted();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void OnTextUpdate(string newText, DecalFont newFont, DecalTextStyle newStyle) {
|
public void OnTextUpdate(string newText, DecalFont newFont, DecalTextStyle newStyle) {
|
||||||
text = newText;
|
text = newText;
|
||||||
_font = newFont;
|
_font = newFont;
|
||||||
@ -40,32 +131,40 @@ namespace ConformalDecals {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void OnFillColorUpdate(Color rgb, Util.ColorHSV hsv) {
|
public void OnFillColorUpdate(Color rgb, Util.ColorHSV hsv) {
|
||||||
|
fillColor = rgb;
|
||||||
Debug.Log($"new fill color: {rgb}, {hsv}");
|
Debug.Log($"new fill color: {rgb}, {hsv}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnOutlineColorUpdate(Color rgb, Util.ColorHSV hsv) {
|
public void OnOutlineColorUpdate(Color rgb, Util.ColorHSV hsv) {
|
||||||
|
outlineColor = rgb;
|
||||||
Debug.Log($"new outline color: {rgb}, {hsv}");
|
Debug.Log($"new outline color: {rgb}, {hsv}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[KSPEvent(guiActive = false, guiActiveEditor = true, guiName = "#LOC_ConformalDecals_gui-select-flag")]
|
public void OnFillToggle() {
|
||||||
public void SetText() {
|
if (!fillEnabled && !outlineEnabled) {
|
||||||
if (_textEntryController == null) {
|
outlineEnabled = true;
|
||||||
_textEntryController = TextEntryController.Create(text, _font, _style, OnTextUpdate);
|
OnOutlineToggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[KSPEvent(guiActive = false, guiActiveEditor = true, guiName = "Set Fill Color")]
|
public void OnOutlineToggle() {
|
||||||
public void SetFillColor() {
|
if (!fillEnabled && !outlineEnabled) {
|
||||||
if (_fillColorPickerController == null) {
|
fillEnabled = true;
|
||||||
_fillColorPickerController = ColorPickerController.Create(fillColor, OnFillColorUpdate);
|
OnFillToggle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[KSPEvent(guiActive = false, guiActiveEditor = true, guiName = "Set Outline Color")]
|
public void OnBeforeSerialize() {
|
||||||
public void SetOutlineColor() {
|
fontName = _font.Name;
|
||||||
if (_outlineColorPickerCOntroller == null) {
|
style = (int) _style.FontStyle;
|
||||||
_outlineColorPickerCOntroller = ColorPickerController.Create(outlineColor, OnOutlineColorUpdate);
|
vertical = _style.Vertical;
|
||||||
}
|
lineSpacing = _style.LineSpacing;
|
||||||
|
characterSpacing = _style.CharacterSpacing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnAfterDeserialize() {
|
||||||
|
_font = DecalConfig.GetFont(fontName);
|
||||||
|
_style = new DecalTextStyle((FontStyles) style, vertical, lineSpacing, characterSpacing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,7 +11,7 @@ namespace ConformalDecals.Text {
|
|||||||
|
|
||||||
public readonly TextRenderer.TextRenderEvent onRenderFinished = new TextRenderer.TextRenderEvent();
|
public readonly TextRenderer.TextRenderEvent onRenderFinished = new TextRenderer.TextRenderEvent();
|
||||||
|
|
||||||
public TextRenderJob(DecalText oldText, DecalText newText, UnityAction<RenderedText> renderFinishedCallback) {
|
public TextRenderJob(DecalText oldText, DecalText newText, UnityAction<TextRenderOutput> renderFinishedCallback) {
|
||||||
OldText = oldText ?? throw new ArgumentNullException(nameof(oldText));
|
OldText = oldText ?? throw new ArgumentNullException(nameof(oldText));
|
||||||
NewText = newText ?? throw new ArgumentNullException(nameof(newText));
|
NewText = newText ?? throw new ArgumentNullException(nameof(newText));
|
||||||
Needed = true;
|
Needed = true;
|
||||||
@ -19,7 +19,7 @@ namespace ConformalDecals.Text {
|
|||||||
if (renderFinishedCallback != null) onRenderFinished.AddListener(renderFinishedCallback);
|
if (renderFinishedCallback != null) onRenderFinished.AddListener(renderFinishedCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextRenderJob( DecalText newText, UnityAction<RenderedText> renderFinishedCallback) {
|
public TextRenderJob(DecalText newText, UnityAction<TextRenderOutput> renderFinishedCallback) {
|
||||||
NewText = newText ?? throw new ArgumentNullException(nameof(newText));
|
NewText = newText ?? throw new ArgumentNullException(nameof(newText));
|
||||||
Needed = true;
|
Needed = true;
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ namespace ConformalDecals.Text {
|
|||||||
IsStarted = true;
|
IsStarted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Finish(RenderedText output) {
|
public void Finish(TextRenderOutput output) {
|
||||||
IsDone = true;
|
IsDone = true;
|
||||||
onRenderFinished.Invoke(output);
|
onRenderFinished.Invoke(output);
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace ConformalDecals.Text {
|
namespace ConformalDecals.Text {
|
||||||
public class RenderedText {
|
public class TextRenderOutput {
|
||||||
public Texture2D Texture { get; private set; }
|
public Texture2D Texture { get; private set; }
|
||||||
|
|
||||||
public Rect Window { get; private set; }
|
public Rect Window { get; private set; }
|
||||||
|
|
||||||
public int UserCount { get; set; }
|
public int UserCount { get; set; }
|
||||||
|
|
||||||
public RenderedText(Texture2D texture, Rect window) {
|
public TextRenderOutput(Texture2D texture, Rect window) {
|
||||||
Texture = texture;
|
Texture = texture;
|
||||||
Window = window;
|
Window = window;
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ namespace ConformalDecals.Text {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class TextRenderEvent : UnityEvent<RenderedText> { }
|
public class TextRenderEvent : UnityEvent<TextRenderOutput> { }
|
||||||
|
|
||||||
private const string BlitShader = "ConformalDecals/Text Blit";
|
private const string BlitShader = "ConformalDecals/Text Blit";
|
||||||
private const int MaxTextureSize = 4096;
|
private const int MaxTextureSize = 4096;
|
||||||
@ -34,26 +34,26 @@ namespace ConformalDecals.Text {
|
|||||||
private TextMeshPro _tmp;
|
private TextMeshPro _tmp;
|
||||||
private Material _blitMaterial;
|
private Material _blitMaterial;
|
||||||
|
|
||||||
private readonly Dictionary<DecalText, RenderedText> _renderCache = new Dictionary<DecalText, RenderedText>();
|
private static readonly Dictionary<DecalText, TextRenderOutput> RenderCache = new Dictionary<DecalText, TextRenderOutput>();
|
||||||
private readonly Queue<TextRenderJob> _renderJobs = new Queue<TextRenderJob>();
|
private static readonly Queue<TextRenderJob> RenderJobs = new Queue<TextRenderJob>();
|
||||||
|
|
||||||
public TextRenderJob RenderText(DecalText text, UnityAction<RenderedText> renderFinishedCallback) {
|
public static TextRenderJob RenderText(DecalText text, UnityAction<TextRenderOutput> renderFinishedCallback) {
|
||||||
var job = new TextRenderJob(text, renderFinishedCallback);
|
var job = new TextRenderJob(text, renderFinishedCallback);
|
||||||
_renderJobs.Enqueue(job);
|
RenderJobs.Enqueue(job);
|
||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextRenderJob UpdateText(DecalText oldText, DecalText newText, UnityAction<RenderedText> renderFinishedCallback) {
|
public static TextRenderJob UpdateText(DecalText oldText, DecalText newText, UnityAction<TextRenderOutput> renderFinishedCallback) {
|
||||||
var job = new TextRenderJob(oldText, newText, renderFinishedCallback);
|
var job = new TextRenderJob(oldText, newText, renderFinishedCallback);
|
||||||
_renderJobs.Enqueue(job);
|
RenderJobs.Enqueue(job);
|
||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnregisterText(DecalText text) {
|
public static void UnregisterText(DecalText text) {
|
||||||
if (_renderCache.TryGetValue(text, out var renderedText)) {
|
if (RenderCache.TryGetValue(text, out var renderedText)) {
|
||||||
renderedText.UserCount--;
|
renderedText.UserCount--;
|
||||||
if (renderedText.UserCount <= 0) {
|
if (renderedText.UserCount <= 0) {
|
||||||
_renderCache.Remove(text);
|
RenderCache.Remove(text);
|
||||||
Destroy(renderedText.Texture);
|
Destroy(renderedText.Texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -70,13 +70,12 @@ namespace ConformalDecals.Text {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void Update() {
|
private void Update() {
|
||||||
TextRenderJob nextJob;
|
bool renderNeeded;
|
||||||
do {
|
do {
|
||||||
if (_renderJobs.Count <= 0) return;
|
if (RenderJobs.Count <= 0) return;
|
||||||
nextJob = _renderJobs.Dequeue();
|
var nextJob = RenderJobs.Dequeue();
|
||||||
} while (nextJob.Needed);
|
renderNeeded = nextJob.Needed && RunJob(nextJob);
|
||||||
|
} while (!renderNeeded);
|
||||||
RunJob(nextJob);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Setup() {
|
private void Setup() {
|
||||||
@ -94,12 +93,12 @@ namespace ConformalDecals.Text {
|
|||||||
_isSetup = true;
|
_isSetup = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RunJob(TextRenderJob job) {
|
private bool RunJob(TextRenderJob job) {
|
||||||
Debug.Log($"Starting Text Rendering Job. queue depth = {_renderJobs.Count}, cache size = {_renderCache.Count}");
|
Debug.Log($"Starting Text Rendering Job. queue depth = {RenderJobs.Count}, cache size = {RenderCache.Count}");
|
||||||
job.Start();
|
job.Start();
|
||||||
|
|
||||||
Texture2D texture = null;
|
Texture2D texture = null;
|
||||||
if (job.OldText != null && _renderCache.TryGetValue(job.OldText, out var oldRender)) {
|
if (job.OldText != null && RenderCache.TryGetValue(job.OldText, out var oldRender)) {
|
||||||
// old output still exists
|
// old output still exists
|
||||||
|
|
||||||
oldRender.UserCount--;
|
oldRender.UserCount--;
|
||||||
@ -109,7 +108,7 @@ namespace ConformalDecals.Text {
|
|||||||
Debug.Log("Render output is not shared with other users, so reusing texture and removing cache slot");
|
Debug.Log("Render output is not shared with other users, so reusing texture and removing cache slot");
|
||||||
|
|
||||||
texture = oldRender.Texture;
|
texture = oldRender.Texture;
|
||||||
_renderCache.Remove(job.OldText);
|
RenderCache.Remove(job.OldText);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// other things are using this render output, so decriment usercount, and we'll make a new entry instead
|
// other things are using this render output, so decriment usercount, and we'll make a new entry instead
|
||||||
@ -119,22 +118,23 @@ namespace ConformalDecals.Text {
|
|||||||
|
|
||||||
// now that all old references are handled, begin rendering the new output
|
// now that all old references are handled, begin rendering the new output
|
||||||
|
|
||||||
if (_renderCache.TryGetValue(job.NewText, out var cachedRender)) {
|
if (RenderCache.TryGetValue(job.NewText, out var cachedRender)) {
|
||||||
Debug.Log("Using Cached Render Output");
|
Debug.Log("Using Cached Render Output");
|
||||||
Debug.Log($"Finished Text Rendering Job. queue depth = {_renderJobs.Count}, cache size = {_renderCache.Count}");
|
Debug.Log($"Finished Text Rendering Job. queue depth = {RenderJobs.Count}, cache size = {RenderCache.Count}");
|
||||||
|
|
||||||
cachedRender.UserCount++;
|
cachedRender.UserCount++;
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var output = RenderText(job.NewText, texture);
|
var output = RenderText(job.NewText, texture);
|
||||||
_renderCache.Add(job.NewText, output);
|
RenderCache.Add(job.NewText, output);
|
||||||
|
|
||||||
job.Finish(output);
|
job.Finish(output);
|
||||||
Debug.Log($"Finished Text Rendering Job. queue depth = {_renderJobs.Count}, cache size = {_renderCache.Count}");
|
Debug.Log($"Finished Text Rendering Job. queue depth = {RenderJobs.Count}, cache size = {RenderCache.Count}");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RenderedText RenderText(DecalText text, Texture2D texture) {
|
public TextRenderOutput RenderText(DecalText text, Texture2D texture) {
|
||||||
// SETUP TMP OBJECT FOR RENDERING
|
// SETUP TMP OBJECT FOR RENDERING
|
||||||
_tmp.text = text.FormattedText;
|
_tmp.text = text.FormattedText;
|
||||||
_tmp.font = text.Font.FontAsset;
|
_tmp.font = text.Font.FontAsset;
|
||||||
@ -220,7 +220,7 @@ namespace ConformalDecals.Text {
|
|||||||
// RELEASE RENDERTEX
|
// RELEASE RENDERTEX
|
||||||
RenderTexture.ReleaseTemporary(renderTex);
|
RenderTexture.ReleaseTemporary(renderTex);
|
||||||
|
|
||||||
return new RenderedText(texture, window);
|
return new TextRenderOutput(texture, window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user