Skip to content

Commit

Permalink
Merge pull request #613 from Shallowmallow/updateReadme
Browse files Browse the repository at this point in the history
Updated readme Toolkit.componentFromString doesn't exist anymore
  • Loading branch information
ianharrigan authored Jul 4, 2024
2 parents 3583cfe + a376db9 commit 0abff41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ _Note: `Screen` was used here as a universal way to add items to the application
It is also possible for HaxeUI to take a user interface definition from a markup language (like XML) and use that to build code similar to above:

```haxe
var main = ComponentMacros.buildComponent("assets/ui/demo/main.xml");
var main = haxe.ui.ComponentBuilder.fromFile("assets/ui/demo/main.xml");
Screen.instance.addComponent(main);
```
If your xml isn't available at compile time you can use `Toolkit.componentFromString`:

```haxe
var main = Toolkit.componentFromString('<vbox><button text="Button" /></vbox>', "xml");
var main = haxe.ui.RuntimeComponentBuilder.fromString('<vbox><button text="Button" /></vbox>', "xml");
Screen.instance.addComponent(main);
```

Expand Down

0 comments on commit 0abff41

Please sign in to comment.