ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. svgSetDocumentXML

Function

svgSetDocumentXML

Replaces the content of an SVG document. The optional function receives the document after the change.

Syntax

bool svgSetDocumentXML(element svgElement, string xml [, function callback = nil])

Arguments

svgElementelement
The SVG document.
xmlstring
New XML content.Different type in MTA:SA: xmlnode xmlDocument
callbackfunction, optional = nil
A function called with the document.

Differences from MTA:SA

  • Arguments in a different colour differ from MTA:SA.

In MTA:SA

svgSetDocumentXML(svg svgElement, xmlnode xmlDocument, function svg)

Returns

true on success.

Example

local svg = svgCreate(100, 20, "<svg/>")
svgSetDocumentXML(svg, '<svg xmlns="http://www.w3.org/2000/svg"><rect width="50" height="20" fill="green"/></svg>')

See also