Add support for right-aligned roomtext

This is mostly so people making levels in an RTL language have a more
pleasant and logical experience. If roomtext is placed in a level set
to RTL, it will get p1=1, which makes that roomtext right-aligned.
Because, imagine for English you click to place roomtext, and the text
runs left of where you clicked, which wouldn't be logical.

Since it's an entity-bound property, switching RTL on and off either in
the editor or via a script does not affect existing entities.
This commit is contained in:
Dav999
2024-01-09 21:50:54 +01:00
committed by Misa Elizabeth Kai
parent 7b46087077
commit 060fe6938d
6 changed files with 26 additions and 4 deletions

View File

@@ -2364,7 +2364,7 @@ void gamerender(void)
//Draw room text!
for (size_t i = 0; i < map.roomtext.size(); i++)
{
font::print(PR_FONT_LEVEL | PR_CJK_LOW, map.roomtext[i].x*8, (map.roomtext[i].y*8), map.roomtext[i].text, 196, 196, 255 - help.glow);
graphics.print_roomtext(map.roomtext[i].x*8, map.roomtext[i].y*8, map.roomtext[i].text, map.roomtext[i].rtl);
}
}