- Documentation
- Server functions
- 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
svgGetDocumentXMLReturns the XML content of an SVG document.svgCreateCreates an SVG document (vector graphics) on the server with the given size in pixels and XML content. The document holds content that can be changed and read (e.g. generate a chart or badge and send its text to clients with an event). The optional function receives the finished document.