GetRootElement: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 18: Line 18:
</syntaxhighlight>
</syntaxhighlight>


==See Also==
{{Element_Functions}}
{{Element_Functions}}

Revision as of 19:38, 20 May 2006

This function returns the root node for the element tree, called map. This represents the map node at the root of the XML document that contains map data.

This is a special element that is consistent across map changes. It is never destroyed and cannot be destroyed using destroyElement. It contains directly, or indirectly every other element in the map.

Syntax

element getRootElement ()

Returns

Returns the root element object.

Example

This example will retrieve the version of the currently loaded map, by reading the version argument from the root element of the element tree.

root = getRootElement ()
version = getElementData ( root, "version" )

See Also

Template:Element Functions