I18n in Torsion
by Lance Hampton · in Torsion · 09/30/2008 (3:06 pm) · 1 replies
So I'm fiddling around with my game and trying to add in some Japanese text. In TGB, this is easy enough. I create a text object that looks like this in the code. There is no problem creating it through the GUI (just make sure to use a font that has Japanese characters, like MS PGothic).
The actual code looks like:
new t2dTextObject() {
canSaveDynamicFields = "1";
Position = "-4.438 -24.075";
size = "58.125 20.000";
text = "くどす Sudoku "; // Japanese and English mix just fine through the GUI
font = "MS PGothic";
wordWrap = "0";
hideOverflow = "1";
textAlign = "Left";
lineHeight = "10";
aspectRatio = "1";
lineSpacing = "0";
characterSpacing = "0";
autoSize = "1";
fontSizes = "80";
textColor = "1 1 1 1";
hideOverlap = "0";
mountID = "7";
};
In Torsion, however, it gives me a bunch of nonsensical characters in place of "くどす" which is what I would like. I assume it's a matter of Torsion opening the file as ASCII and not UTF-8, or something like that.
I'd like to be creating these text objects on the fly, without having to create them in the GUI. So I'd like to be able to write up a list of the Japanese words in a .cs file directly through Torsion because that's what I'm using for everything else.
The current workaround is easy enough, I can edit the files just fine in emacs or another editor and then open later in Torsion. But it would be nice to be able to read them in Torsion.
Priority: LOW (Cosmetic) - workaround available.
The actual code looks like:
new t2dTextObject() {
canSaveDynamicFields = "1";
Position = "-4.438 -24.075";
size = "58.125 20.000";
text = "くどす Sudoku "; // Japanese and English mix just fine through the GUI
font = "MS PGothic";
wordWrap = "0";
hideOverflow = "1";
textAlign = "Left";
lineHeight = "10";
aspectRatio = "1";
lineSpacing = "0";
characterSpacing = "0";
autoSize = "1";
fontSizes = "80";
textColor = "1 1 1 1";
hideOverlap = "0";
mountID = "7";
};
In Torsion, however, it gives me a bunch of nonsensical characters in place of "くどす" which is what I would like. I assume it's a matter of Torsion opening the file as ASCII and not UTF-8, or something like that.
I'd like to be creating these text objects on the fly, without having to create them in the GUI. So I'd like to be able to write up a list of the Japanese words in a .cs file directly through Torsion because that's what I'm using for everything else.
The current workaround is easy enough, I can edit the files just fine in emacs or another editor and then open later in Torsion. But it would be nice to be able to read them in Torsion.
Priority: LOW (Cosmetic) - workaround available.
Associate James Ford
Sickhead Games