-
Posted by xit_draka on Sun, 16 Dec 2012 21:46:01
Suppose I have the following in an .xml file:
<FontString name="Options_ColorLabel" inherits="GameFontNormal" text="Color:"> <Anchors> <Anchor point="TOPLEFT"> <Offset> <AbsDimension x="33" y="-225"/> </Offset> </Anchor> </Anchors> </FontString>
I also have a lua function defined in a .lua file that when called with an argument it provides me back a localized string. How do I change the text of this FontString to the localized content?
-
Posted by jnwhiteh on Sun, 16 Dec 2012 22:27:52
I don't think you can automatically using the text attribute. If you want to do it manually you'll need to call, do the translation, and set the text.
-
Posted by xit_draka on Sun, 16 Dec 2012 23:09:17
Right. I didn't see a Script element that is available for the FontString. Other Form elements like buttons, check boxes, etc. I was able to do this with a Script OnLoad element. Just wondered if there was a way in the lua that I can reference the FontString and change the text attribute manually.
-
Posted by jnwhiteh on Mon, 17 Dec 2012 08:02:05
You set a script in the frame to which the font string belongs and then access it. That's all, nothing special =)
-
Posted by jnwhiteh on Mon, 17 Dec 2012 08:09:10
I normally construct everything in Lua and then set things explicitly using my localized version.