How to use HaxeUI?


#1

Why can’t I find a HaxeUI framework that can be used in Openfl 8.0, is HaxeUI not supported?:disappointed_relieved:


OpenFL 8.0.2 released
#2

I believe HaxeUI on GIT supports OpenFL 8, but the updates have not been released to Haxelib yet


#3

What is the common resolution adaptation in Openfl? Zoom? Or set the height and width?


#4

I’ve seen people using a Sprite container for their content, then using width/height to scale


#5

If you want the easiest possible solution, try this. If you want more control and no letterboxing, use a layout library instead.


#6

Thanks, this is a good idea:grinning:


#7

I found that HaxeUI’s ListView does not use a garbage pool and that a large amount of data can cause a stall. HaxeUI related questions, can I ask here?


#8
list = new ListView();
list.width = getStageWidth();
list.height = getStageHeight();

for(i in 0...100)
    list.dataSource.add("123");

list.itemRendererClass = app.view.item.GameItem;

this.addChild(list);

If you use this code implementation, even unseen children will be added to addChild. It will also have 100 children, which is not suitable for data lists, or whether other components have not been found?


#9

Unseen children being added is not wrong, OpenFL won’t render unless it knows it’s visible


#10

Emmm, you are right, but HaxeUI’s list is not suitable for storing large amounts of data. I have already implemented a new List that can store 10,000+ pieces of data at a time and run at 60 FPS. Currently HaxeUI can only be abandoned.

How HaxeUI’s List can use the garbage pool, it is estimated that it can easily run 60FPS.


#11

Perhaps you should talk to @IanHarrigan1982 about this, I’m sure he would not be against optimizations


#12

… … Late to the party as usual… … :slight_smile:

What issues are you having with haxeui (except the listview). It should work with openfl8 i believe. Are you getting compiler errors? It should be in haxelib too (i think).

As for ListView, yeah, in the version that is in master branch its not suitable for large data sets. Simply put there is no virtualization at all. This means 1 data point = 1 item renderer, and that item renderer is likely to be composed of many components, meaning that a list of 1000 items can very quickly lead to 1000’s upon 1000’s of components (which for openfl are sprites). Clearly not ideal.

However, there is a new branch (that isnt released yet - “new-component-method”) that has a new listview in it that DOES pool item renders, and so you only get whats on screen, So if you have 1000 items, but can only show 5, then you only have 5 item renders (in practice its actually 6, n+1 - to make it look nicer for smooth scrolling). https://twitter.com/IanHarrigan1982/status/986575592861597696

Ive used this method with 1,000,000 items and it was fine: https://twitter.com/IanHarrigan1982/status/984116195443068931 (note that last link is the “ugly” version - it works much better now like in the 1st link, ie, virtual, smooth and inertial).

So your options are: dont have 10,000 items and use master, use the branch and understand its in heavy development, or as you say, abandon HaxeUI - choice of course, is yours. :slight_smile:

Also, if you want to ask HaxeUI related stuff you can usually grab me (or others) here: https://gitter.im/haxeui/general - chances are ill get that quicker as i dont check forums all the time, so unless im pinged i usually wont see it.

Cheers,
Ian


#13

Thanks, I need these, Cheers!:smiley: