From bab28f681c14d3c0bde9d0cf019290387004a7c2 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Tue, 25 Feb 2025 10:02:16 +0100 Subject: [PATCH] Xml Guide --- docs/guides/xml.md | 141 ++++++++++++++++++++++ docs/references/plugins/pluginTemplate.md | 10 -- 2 files changed, 141 insertions(+), 10 deletions(-) create mode 100644 docs/guides/xml.md delete mode 100644 docs/references/plugins/pluginTemplate.md diff --git a/docs/guides/xml.md b/docs/guides/xml.md new file mode 100644 index 0000000..1ec253f --- /dev/null +++ b/docs/guides/xml.md @@ -0,0 +1,141 @@ +# XML in Basalt + +Basalt provides an XML parser that lets you define your UI layout in a declarative way. This can make your code more readable and maintainable. + +## Basic Usage + +```lua +local main = basalt.getMainFrame() + +-- Load from file +local xmlFile = fs.open("myUI.xml", "r") +main:loadXML(xmlFile.readAll()) +xmlFile.close() + +-- Or directly as string +main:loadXML([[ + + +``` + +## Property Types + +The XML parser automatically converts values based on the property type: + +```xml + + +``` \ No newline at end of file diff --git a/docs/references/plugins/pluginTemplate.md b/docs/references/plugins/pluginTemplate.md deleted file mode 100644 index 888e90f..0000000 --- a/docs/references/plugins/pluginTemplate.md +++ /dev/null @@ -1,10 +0,0 @@ -Will temporary exist so that we don't lose track of how the plugin system works -## VisualElement.hooks.init() -Hooks into existing methods (you can also use init.pre or init.post) - -## VisualElement.setup() -Called on Class level to define properties and setup before instance is created - -## VisualElement:testFunc() -Adds a new method to the class -