Using strings in menus.
This is pretty much a translation of my old tutorial that I wrote for darth-arth.de.
Strings can be useful if you want to translate your mod in several languages or if you have a lot of text.
It's just way more clearly than writing the text right into the menu file.
The syntax in the menu files is like that:
text @[stringfile]_[name of the string]
For example:
text @MENUS_NEW
This string is located in "MENUS.str" and the name of the string is "New".
A string file needs to be in the folder strings/[language]
For example strings/english .
It needs to have the file extension .str and is for example looking like that:
//example.str VERSION "1" CONFIG "W:\bin\stringed.cfg" FILENOTES "Text printed at console" REFERENCE MYLINK LANG_ENGLISH "This text is/n cool!" ENDMARKER
At the beginning there needs to be the stuff with VERSION,CONFIG und FILENOTES. And in the end there is the ENDMARKER command.
Reference is the "link" to your text. The actual text is written behind the command LANG_ENGLISH.
Line breaks can be done with /n.
This is an example of how it could look like in the menu:
itemDef { name example text @example_MYLINK style WINDOW_STYLE_EMPTY rect 100 200 130 24 font 4 textscale 1.1 textalign ITEM_ALIGN_CENTER textstyle 3 textalignx 65 textaligny -1 forecolor 1 1 1 1 visible 1 decoration }
In the game it would look like this:
This text is
cool!
I hope you learned something new. Good luck with your menus
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now