Skip to content

Commit 3527e34

Browse files
committed
Optimize draw_text_dynamic (part 3)
- Avoid drawing dynamic text in English completely, since it's not necessary. This causes performance to be slightly better when using English vs. Chinese, but the performance improvements in previous commits should make it better to use compared to the previous versions. - Adds commented "part 4" which is disabling dynamic text completely. It's possible to draw everything using Source Han Sans when using Chinese, but the character widths look unbalanced. So for aesthetic reasons, we'll keep using dynamic text this time.
1 parent ba05d3f commit 3527e34

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/draw_text_dynamic/draw_text_dynamic.gml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
function draw_text_dynamic(x, y, string){
22
// draw_text_dynamic()
3+
4+
// Skip drawing dynamic text when using English
5+
if (!force && obj_controller.language != 1) {
6+
draw_text(x, y, string);
7+
return;
8+
}
9+
10+
/*
11+
// Disable dynamic text on Chinese (use Source Han Sans for everything)
12+
if (obj_controller.language == 1) {
13+
draw_theme_font(obj_controller.currentfont, true)
14+
}
15+
draw_text(x, y - 2 * (obj_controller.language == 1), string);
16+
return;
17+
*/
18+
319
var width = 0;
420
var lines = 0;
521
var linewidth = [0];

0 commit comments

Comments
 (0)