Skip to content

Commit ac63144

Browse files
author
Evrim Öztamur
committed
Add NeoText property for control character substitution
1 parent e4f9d95 commit ac63144

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Dungeoneer/src/com/interrupt/dungeoneer/entities/NeoText.java

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ public class NeoText extends DirectionalEntity {
1515
@EditorProperty
1616
public DrawableText.TextAlignment textAlignment = DrawableText.TextAlignment.CENTER;
1717

18+
@EditorProperty
19+
public boolean substituteControlLiterals;
20+
1821
public NeoText() {
1922
this.drawable = new DrawableText(this.text);
2023
this.isDynamic = false;

Dungeoneer/src/com/interrupt/dungeoneer/gfx/drawables/DrawableText.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ public void update(Entity e) {
3434

3535
if (e instanceof NeoText) {
3636
NeoText parentNeoText = (NeoText)e;
37-
text = parentNeoText.text;
38-
text = text.replace("\\n", "\n"); // Hack in support for newlines in the editor.
37+
3938
color.set(parentNeoText.textColor);
4039

40+
text = parentNeoText.text;
41+
42+
if (parentNeoText.substituteControlLiterals) {
43+
text = text.replace("\\n", "\n"); // Hack in support for newlines in the editor.
44+
}
45+
4146
switch (parentNeoText.textAlignment) {
4247
case LEFT:
4348
alignmentOffset = 0.0f; break;

0 commit comments

Comments
 (0)