mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 01:48:15 +03:00
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:
committed by
Misa Elizabeth Kai
parent
7b46087077
commit
060fe6938d
@@ -3602,3 +3602,15 @@ void Graphics::render_roomname(uint32_t font_flag, const char* roomname, int r,
|
||||
font::print(font_flag | PR_CEN | PR_BOR | PR_CJK_LOW, -1, footerrect.y+1, roomname, r, g, b);
|
||||
set_blendmode(SDL_BLENDMODE_NONE);
|
||||
}
|
||||
|
||||
void Graphics::print_roomtext(int x, const int y, const char* text, const bool rtl)
|
||||
{
|
||||
uint32_t flags = PR_FONT_LEVEL | PR_CJK_LOW;
|
||||
|
||||
if (rtl)
|
||||
{
|
||||
flags |= PR_RIGHT;
|
||||
x += 8; // the size of a tile, not font width!
|
||||
}
|
||||
font::print(flags, x, y, text, 196, 196, 255 - help.glow);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user