haxeui-kha icon indicating copy to clipboard operation
haxeui-kha copied to clipboard

Image can't be displayed

Open R3D9477 opened this issue 8 years ago • 8 comments

Expected Behavior

A simple window with one image (jpg).

Current Behavior

Blank screen.

Test app / minimal test case

Sample available here.

Your Environment

Haxe 3.4.2 Kha from git haxeui-core from git haxeui-kha from git

Thanks.

R3D9477 avatar Apr 03 '17 09:04 R3D9477

for Kha image must be called without extension: <image resource="Tux" /> (correct) instead of <image resource="Tux.jpg" /> (not correct)

R3D9477 avatar Apr 04 '17 07:04 R3D9477

IMO, this should actually be handled by the kha backend, so you have consistent functionality across all backends.

sh-dave avatar Apr 04 '17 07:04 sh-dave

@sh-dave what did you mean? Is it invalid behavior and bug of haxeui-kha backaned? Does method <image resource="Tux.jpg" /> should be work?

R3D9477 avatar Apr 04 '17 08:04 R3D9477

IMO yes. If you can use <image resource="FILENAME.EXT" /> in say the OpenFL backend, you should also be able to use that in the Kha backend and not have to remember "oh, i'm on Kha, so i have to manually strip the extension".

sh-dave avatar Apr 04 '17 08:04 sh-dave

This is handled by the backend, images are either use native to the framework, or are haxe resources and are converted into what is native to the framework. What haxe target are you using? CPP?

Either way, ill take a look at your sample when i get some time.

Cheers, Ian

ianharrigan avatar Apr 04 '17 09:04 ianharrigan

@sh-dave: i see what you are saying though, the whole idea of haxeui is uniformity. That said, there are resource plugins that can handle this, that said, im not sure they are applied globally. Only to resources you explicitly include in module.xml

ianharrigan avatar Apr 04 '17 09:04 ianharrigan

actually, they are global ( :) )... so something like this should work (its untested at the moment).

module.xml:

<module>
	<plugins>
		<plugin type="asset" class="haxe.ui.assets.AssetNamePlugin" if="kha" removeExtension="true"/>
	</plugins>
</module>

ianharrigan avatar Apr 04 '17 10:04 ianharrigan

@ianharrigan there was tested for html5 target (debugging in KhaStudio)

R3D9477 avatar Sep 11 '17 12:09 R3D9477