Dynamic Signs
From Rigs of Rods Wiki
| Requires |
| 0.34 |
| or later |
Dynamic signs allow you to create signs with different text with only one mesh, avoiding many different meshes with different text.
This example mimics the North St. Helens sign.
The text parameters are set in the .odef file.
- To enable dynamic signage, set the mesh materal, such as setMeshMaterial tracks/bigsign/town
- From there, each line of text follows:
;drawTextOnMeshTexture x, y, width, height, R, G, B, A, option, fontname, text
drawTextOnMeshTexture 0.1, 0.4, 1, 0.3, 0, 0.8, 0, 1, l, SignFont_Small Welcome_to
drawTextOnMeshTexture 0.1, 0.6, 1, 0.3, 0, 0.8, 0, 1, l, SignFont_Big {{argument1}}
- Where the syntax is:
- x,y = where on the target material the text should be drawn (in percent, so 1=100% and 0=0%)
- width = width of the text area to draw in (in percent)
- height = height of the area to draw in (in percent)
- R,G,B,A = specify the font color in its parts red, green, blue, and alpha respectively
- Option = one character text alignment option, possible values:
- l - left alignment
- c - center alignment
- r - right alignment
- font name = any Ogre font you want to use
- list of available fonts is available in /data/OgreCore/*.fontdef
- text = text to be drawn onto the sign, you can use {{argument1}} if you want to take over an argument specified in to .terrn file. For example:
- Using the previous example in the odef:
;drawTextOnMeshTexture x, y, width, height, R, G, B, A, option, fontname, text
drawTextOnMeshTexture 0.1, 0.4, 1, 0.3, 0, 0.8, 0, 1, l, SignFont_Small Welcome_to
drawTextOnMeshTexture 0.1, 0.6, 1, 0.3,0, 0.8, 0, 1, l, SignFont_Big {{argument1}}
- In the terrn: 1065.61, 33.8373, 992.505, 0, 2.91314, 0, bigsign_town sign Coldwater
The final result:



(gold)
(silver)
(bronze)

