• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED]Is there a way to manually set the halign point?

Pfap

Member
I'm working on localizing a game and most of the foreign text works with my existing code except for the Japanese and Chinese translations. I'm using fonts from Google and they are in .otf file format. Here is the Japanese one: https://fonts.google.com/specimen/Noto+Sans+JP?selection.family=Noto+Sans+JP

For some reason the text is drawn way to the left when using the existing code for English, so the current idea I have is that if Japanese is selected then I will set a variable with the difference that needs to be spanned.
Code:
draw_text(x+(sprite_width/2)+global.add_text,y,text);
So, global.add_text will be set to 0 for all languages except for Japanese and Chinese. The value for global.add_text for the Japanese font is currently 56.

My question: is there a way to adjust the font, so that it works with other offsets? The font is "off" by 56 and once I add that to the x draw position everything is centered and looks nice.
 

Pfap

Member
I'm working on localizing a game and most of the foreign text works with my existing code except for the Japanese and Chinese translations. I'm using fonts from Google and they are in .otf file format. Here is the Japanese one: https://fonts.google.com/specimen/Noto+Sans+JP?selection.family=Noto+Sans+JP

For some reason the text is drawn way to the left when using the existing code for English, so the current idea I have is that if Japanese is selected then I will set a variable with the difference that needs to be spanned.
Code:
draw_text(x+(sprite_width/2)+global.add_text,y,text);
So, global.add_text will be set to 0 for all languages except for Japanese and Chinese. The value for global.add_text for the Japanese font is currently 56.

My question: is there a way to adjust the font, so that it works with other offsets? The font is "off" by 56 and once I add that to the x draw position everything is centered and looks nice.

Never mind, my translation file had added white space on the end of the Japanese and Chinese text.
 
Top