From d7a6885af653c8318913921dc28d98a840596c59 Mon Sep 17 00:00:00 2001 From: Sabine Lim Date: Fri, 19 May 2023 17:32:38 +1000 Subject: [PATCH] Update xml.md (#86) --- docs/guides/xml.md | 180 ++++++++++++++++++++++++++++++--------------- 1 file changed, 122 insertions(+), 58 deletions(-) diff --git a/docs/guides/xml.md b/docs/guides/xml.md index 6762641..6fc9c5d 100644 --- a/docs/guides/xml.md +++ b/docs/guides/xml.md @@ -2,14 +2,14 @@ XML (eXtensible Markup Language) is a popular and widely-used markup language fo ## Loading an XML File in Basalt -To load an XML file in Basalt, you'll need to use the `frame:loadLayout` function. This function reads an XML file and returns a table containing the parsed XML data. +To load an XML file in Basalt, you'll need to use the `container:loadLayout` function. This function reads an XML file and runs any scripts or adds any objects within. Here's an example of how to load an XML file: ```lua local basalt = require("basalt") -local main = basalt.createFrame():loadLayout("path/to/your/layout.xml") +basalt.createFrame():loadLayout("path/to/your/layout.xml") ``` Make sure that the specified XML file is accessible and located within your project's file system. @@ -21,108 +21,172 @@ Basalt uses XML to define UI elements and their properties. By using XML, you ca Here's an example of an XML file that defines a simple UI layout for Basalt: ```xml -