[0.5.3] Could I implement a CollapsibleDialog in my Scripted SubState? Are they useable or not? #4268
-
I try adding a CollapsibleDialog in my own ScriptedMusicSubState (similarly to the Chart/Stage Editor ones), is it possible? class CustomState extends ScriptedMusicBeatSubState {
override function create() {
super.create();
var collapsibleDialogue = new CollapsibleToolbox();
collapsibleDialogue.x = 100;
collapsibleDialogue.y = 150;
add(collapsibleDialogue);
}
}
@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/difficulty.xml"))
class CollapsibleToolbox extends CollapsibleDialog {
var collapsibleToolboxButton:Button;
function new() {
super();
collapsibleToolboxButton.onClick = function(_) {
trace("Test");
};
}
} Doesn't seem to work and errors with:
Would appreciate help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I think the problem is that you're using a macro (in this case Try using something like
|
Beta Was this translation helpful? Give feedback.
I think the problem is that you're using a macro (in this case
@:build
) to add child components to your collapsible dialog, however those macros aren't supported in hscriptTry using something like
RuntimeComponentBuilder
if you're gonna build components using an .xml file or write the components in the code (more specifically in thenew
function) like this: