diff --git a/Dungeoneer/src/com/interrupt/dungeoneer/entities/NeoText.java b/Dungeoneer/src/com/interrupt/dungeoneer/entities/NeoText.java index 81e09821..feece360 100644 --- a/Dungeoneer/src/com/interrupt/dungeoneer/entities/NeoText.java +++ b/Dungeoneer/src/com/interrupt/dungeoneer/entities/NeoText.java @@ -15,6 +15,9 @@ public class NeoText extends DirectionalEntity { @EditorProperty public DrawableText.TextAlignment textAlignment = DrawableText.TextAlignment.CENTER; + @EditorProperty + public boolean substituteControlLiterals; + public NeoText() { this.drawable = new DrawableText(this.text); this.isDynamic = false; diff --git a/Dungeoneer/src/com/interrupt/dungeoneer/gfx/drawables/DrawableText.java b/Dungeoneer/src/com/interrupt/dungeoneer/gfx/drawables/DrawableText.java index 80df3f6b..73a4a597 100644 --- a/Dungeoneer/src/com/interrupt/dungeoneer/gfx/drawables/DrawableText.java +++ b/Dungeoneer/src/com/interrupt/dungeoneer/gfx/drawables/DrawableText.java @@ -34,10 +34,15 @@ public void update(Entity e) { if (e instanceof NeoText) { NeoText parentNeoText = (NeoText)e; - text = parentNeoText.text; - text = text.replace("\\n", "\n"); // Hack in support for newlines in the editor. + color.set(parentNeoText.textColor); + text = parentNeoText.text; + + if (parentNeoText.substituteControlLiterals) { + text = text.replace("\\n", "\n"); // Hack in support for newlines in the editor. + } + switch (parentNeoText.textAlignment) { case LEFT: alignmentOffset = 0.0f; break;