billions-carpenter-3485
02/15/2022, 10:07 PMbrave-kangaroo-30399
02/17/2022, 3:13 AMscaleMode="none"? Like how scrollview does automaticallybrave-kangaroo-30399
02/17/2022, 3:16 AMcomponentClipRect in codebrave-kangaroo-30399
02/17/2022, 3:17 AMxml
<box width="558" height="299" top="28" left="41">
<absolute width="100%" height="100" horizontalAlign="center" verticalAlign="bottom">
<image id="myImage" resource="image.png" width="100%" height="100" scaleMode="none" />
<label id="myText" text="" width="100%" height="100" style="font-size: 32px;font-bold: true;" />
</absolute>
</box>bright-gpu-74537
02/17/2022, 7:24 AMbright-gpu-74537
02/17/2022, 7:24 AMstyle="clip:true" ?bright-gpu-74537
02/17/2022, 7:24 AMbright-gpu-74537
02/17/2022, 7:27 AMclip:true sets the comonentClipBounds to the size of the component (including when it resizes), so anything gets clipped - i actually toyed with making this the default tbh, since the behaviour is more normal imo, but its expensive, so decided not to.... scrollviews dont use this, they directly use compoentClipRect (since the clipping is more dynamic based on a scroll position)brave-kangaroo-30399
02/17/2022, 3:27 PMbillions-carpenter-3485
02/17/2022, 9:08 PMToolkit.componentFromString('<vbox><button text="Button" /></vbox>', "xml")billions-carpenter-3485
02/17/2022, 9:11 PMbillions-carpenter-3485
02/17/2022, 9:43 PMtrace(RuntimeComponentBuilder.fromString(src, 'xml')); But i doesn't work WARNING: no class found for component: vbox sooo how i get it worked xDbillions-carpenter-3485
02/17/2022, 9:50 PMhaxe
package ;
import haxe.ui.Toolkit;
import haxe.ui.RuntimeComponentBuilder;
class Main {
public static function main() {
var src = '<vbox><button text="Button" /></vbox>';
Toolkit.init();
trace(RuntimeComponentBuilder.fromString(src, 'xml'));
}
}
-cp src
-main Main
--dce no
-lib haxeui-core
-lib haxeui-html5
-lib vscode
--macro include('haxe.ui.containers', true)
--macro include('haxe.ui.components', true)
-js build/html5/Main.jsbright-gpu-74537
02/17/2022, 10:16 PMbright-gpu-74537
02/17/2022, 10:17 PMbright-gpu-74537
02/18/2022, 8:47 AMhaxe
ComponentClassMap.register("vbox", "haxe.ui.containers.VBox");
ComponentClassMap.register("button", "haxe.ui.components.Button");
But obviously that isnt ideal, so you can also just create a module.xml (on your classpath, for example in src) and put the following in it:
xml
<module>
<components>
<class package="haxe.ui.core" loadAll="true" />
<class package="haxe.ui.components" loadAll="true" />
<class package="haxe.ui.containers" loadAll="true" />
<class package="haxe.ui.containers.dialogs" loadAll="true" />
<class package="haxe.ui.containers.menus" loadAll="true" />
<class package="haxe.ui.containers.properties" loadAll="true" />
</components>
</module>
(the loadAll is a new attribute that tells the module phase to put everything from that package that extends Component in the classmap automatically - this will mean a reference to all components will be made - but for runtime stuff that'd be what you want)brainy-machine-50829
02/18/2022, 11:08 AMroot.addView(...)? With regards to ease of compilation and flexibility and such.bright-gpu-74537
02/18/2022, 11:18 AMbright-gpu-74537
02/18/2022, 11:18 AMbillions-carpenter-3485
02/18/2022, 12:19 PMbrainy-machine-50829
02/18/2022, 1:45 PMbrainy-machine-50829
02/18/2022, 1:46 PMbrainy-machine-50829
02/18/2022, 1:46 PMbrainy-machine-50829
02/18/2022, 1:47 PMbrainy-machine-50829
02/18/2022, 1:48 PMbrainy-machine-50829
02/18/2022, 1:48 PMbright-gpu-74537
02/18/2022, 2:33 PMbrainy-machine-50829
02/18/2022, 2:36 PMambitious-knife-25690
02/18/2022, 2:36 PMambitious-knife-25690
02/18/2022, 2:37 PM