bright-gpu-74537
09/03/2022, 8:33 AMvar error-label isnt a valid haxe identifier... ... that said, in various places haxeui will attempt to change variable names into "safe" versions (so error-label would become errorLabel), so i must have missed one somewhere... ill check it outbright-gpu-74537
09/03/2022, 8:34 AMbright-gpu-74537
09/03/2022, 9:34 AMastonishing-lifeguard-55916
09/03/2022, 9:38 AMbright-gpu-74537
09/03/2022, 9:39 AMblue-lock-94355
09/03/2022, 11:10 AMh2d.Tile to HaxeUI to display it? The reason why I don't use images from files and specify them in xml file as string is because I have a texture atlas from which I extract sub tiles
I have tried to create sub-tile and parent it to the component, but this solution does not suit for mebright-gpu-74537
09/03/2022, 11:13 AMtypedef ImageData = hxd.BitmapData; so that might be an option toobright-gpu-74537
09/03/2022, 11:14 AMbright-gpu-74537
09/03/2022, 11:16 AMtile.getTexture().capturePixels(...) and then turn that into a bitmap (?), but it all feels a little smelly... i think the best option would be a wrapper component, no?bright-gpu-74537
09/03/2022, 11:20 AMblue-lock-94355
09/03/2022, 11:31 AMTile instead of Bitmap
so
1. is it possible to add Bitmap to the Toolkit and use it in haxe.ui.components.Image as resource?
2. is it possible to directly set Bitmap to the haxe.ui.components.Image?blue-lock-94355
09/03/2022, 11:32 AMbright-gpu-74537
09/03/2022, 11:38 AMbright-gpu-74537
09/03/2022, 11:38 AMblue-lock-94355
09/03/2022, 11:39 AMBitmapData to Image?bright-gpu-74537
09/03/2022, 11:40 AMbright-gpu-74537
09/03/2022, 11:40 AMblue-lock-94355
09/03/2022, 11:43 AMresource is haxe.ui.util.Variant, yeah thx for solution, it should workbright-gpu-74537
09/03/2022, 11:43 AMbright-gpu-74537
09/03/2022, 11:54 AMbright-gpu-74537
09/03/2022, 11:55 AMhaxe
var bmp1 = new hxd.BitmapData(100, 100);
bmp1.fill(0, 0, 100, 100, 0xff0000ff);
bmp1.line(0, 0, 100, 100, 0xffffff00);
bmp1.line(100, 0, 0, 100, 0xffffff00);
var bmp2 = new hxd.BitmapData(100, 100);
bmp2.fill(0, 0, 100, 100, 0xffff0000);
bmp2.line(0, 0, 100, 100, 0xff000000);
bmp2.line(100, 0, 0, 100, 0xff000000);
var bmp3 = new hxd.BitmapData(100, 100);
bmp3.fill(0, 0, 100, 100, 0xff00ff00);
bmp3.line(0, 0, 100, 100, 0xffff0000);
bmp3.line(100, 0, 0, 100, 0xffff0000);
// just so we can use it from styles too!
StyleLookupMap.instance.set("bmp1", bmp1);
StyleLookupMap.instance.set("bmp2", bmp2);
StyleLookupMap.instance.set("bmp3", bmp3);
myImage.resource = bmp2;
myButton.icon = bmp1;bright-gpu-74537
09/03/2022, 11:55 AMxml
<image id="myImage" />
<button id="myButton" text="Some Button" />
<style>
.myStyle {
icon: lookup("bmp1");
}
.myStyle:hover {
icon: lookup("bmp2");
}
.myStyle:down {
icon: lookup("bmp3");
}
</style>
<button styleName="myStyle" text="Another Button" iconPosition="top" />blue-lock-94355
09/03/2022, 11:56 AMBitmap or Tile to BitmapData?bright-gpu-74537
09/03/2022, 11:57 AMbright-gpu-74537
09/03/2022, 11:57 AMcapturePixels(face:Int = 0, mipLevel:Int = 0, ?region:IBounds):Pixels
Downloads the current texture data from the GPU. Beware, this is a very slow operation that shouldn't be done during rendering.bright-gpu-74537
09/03/2022, 11:58 AMfull-journalist-82607
09/04/2022, 3:43 PM<hbox id="hbox" style="padding: 5px;">
<button id="button" text="Click Me!" onclick="var screen = button.screen; button.parentComponent.removeComponent(button);screen.addComponent(button);" style="font-size: 24px;" />
</hbox>
It doesn't work even after a timer or callLaterbright-gpu-74537
09/04/2022, 3:48 PMbright-gpu-74537
09/04/2022, 3:48 PMbright-gpu-74537
09/04/2022, 3:49 PM