13,212
edits
m (cat: XML, Aircraft enhancement) |
(+- Rewriting the first section; Syntax highlighting; + Related content; etc) |
||
Line 1: | Line 1: | ||
Using '''OSG Text''' one can add text to models in FlightGear. The text can be modified runtime and can be animated using many of the animations available. | |||
Text are scene nodes configured using XML and may appear within a model description file, like other models or the particle system. | |||
== Syntax example == | |||
For the anxious reader, here is a complete example of a text node: | For the anxious reader, here is a complete example of a text node: | ||
<!-- Must be enclosed by a <text/> node | <syntaxhighlight lang="xml"> | ||
<!-- Must be enclosed by a <text/> node --> | |||
<text> | <text> | ||
<!-- It should have a name. Can be used for other animations --> | <!-- It should have a name. Can be used for other animations --> | ||
Line 95: | Line 97: | ||
</text> | </text> | ||
</syntaxhighlight> | |||
The <text/> node may appear within <model/> or <PropertyList/> nodes. If you place | The <text/> node may appear within <model/> or <PropertyList/> nodes. If you place | ||
Line 101: | Line 104: | ||
Your model.xml file: | Your model.xml file: | ||
<syntaxhighlight lang="xml"> | |||
<model> | <model> | ||
<path>may-fancy-model.ac</path> | <path>may-fancy-model.ac</path> | ||
<text include="HelloWorld.xml"/> | <text include="HelloWorld.xml"/> | ||
</model> | </model> | ||
</syntaxhighlight> | |||
Your HelloWorld.xml: | |||
<syntaxhighlight lang="xml"> | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<PropertyList> | |||
<name>Hello World</name> | |||
<font>Helvetica.txf</font> | |||
<type type="string">literal</type> | |||
<text type="string">Hello, world!</text> | |||
<!-- etc. - you get the idea --> | |||
</PropertyList> | |||
</syntaxhighlight> | |||
Animation can be applied to text nodes like any other object. To give your text some | Animation can be applied to text nodes like any other object. To give your text some | ||
color, use the material animation, or translate, rotate, scale or spin your text as | color, use the material animation, or translate, rotate, scale or spin your text as | ||
you like. | you like. | ||
== Related content == | |||
=== Wiki articles === | |||
* [[Howto:Animate models]] | |||
* [[Property tree]] | |||
* [[PropertyList XML files]] | |||
=== Readme file === | |||
* {{readme file|osgtext}} | |||
=== Forum topics === | |||
* [http://forum.flightgear.org/viewtopic.php?f=14&t=5740 "text" animation type wish] (August 2009–Spetember 2010) | |||
=== Source code === | |||
* {{repo link | |||
| site = sf | |||
| proj = flightgear/simgear | |||
| type = git | |||
| view = tree | |||
| brrev = next | |||
| path = simgear/scene/model/SGText.hxx | |||
}} | |||
* {{repo link | |||
| site = sf | |||
| proj = flightgear/simgear | |||
| type = git | |||
| view = tree | |||
| brrev = next | |||
| path = simgear/scene/model/SGText.cxx | |||
}} | |||
[[Category:XML]] | [[Category:XML]] | ||
[[Category: Aircraft enhancement]] | [[Category: Aircraft enhancement]] |