https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • m

    melodic-advantage-23638

    01/13/2023, 12:59 AM
    The reason I'm doing this is because I've been working on resurrecting an engine called BabylonHx and it is doesn't have a GUI framework. I'd like to bolt HaxeUI on as the GUI implementation.
  • h

    hallowed-ocean-84954

    01/13/2023, 1:00 AM
    font drawing directly in GL is going to be fun - I did some in a frag shader for a helloworld thing but doing it for real would have a lot of things to take care of - of course you could use textures for the letters rather than drawing them
  • m

    melodic-advantage-23638

    01/13/2023, 1:02 AM
    Yeah, to be honest I'm just going to borrow the code from another engine. I was looking at heaps implementation and it uses a bitmapped font and builds out a vertex buffer, rendering each letter as a quad with UVs mapped to the font texture.
  • h

    hallowed-ocean-84954

    01/13/2023, 1:13 AM
    oh ok - makes sense
  • m

    melodic-advantage-23638

    01/13/2023, 2:49 AM
    Ya cool I've been able to figure out how to start debugging this using the heaps backend whew
  • b

    bright-gpu-74537

    01/13/2023, 7:12 AM
    So @melodic-advantage-23638 - you are pretty spot on, native backends map haxeui-core components to some native widget framework (like wx, or qt, etc). Composite backends (which is basically all of them) simply implement a number of functions in ComponentImpl (and other "Impl" classes) and then all of the haxeui composite components are available to you
  • b

    bright-gpu-74537

    01/13/2023, 7:13 AM
    the first steps i usually do are i copy the skeleton backend and just make sure that works... so copy it somewhere and rename to, dunno, "haxeui-gl", then
    haxellib dev haxeui-gl /path/to/folder
  • b

    bright-gpu-74537

    01/13/2023, 7:13 AM
    then i include that in a test project and make sure that i get all the traces...
  • b

    bright-gpu-74537

    01/13/2023, 7:15 AM
    then i usually do something like
    <box width="100" height="100" style="background-color:red" />
    and then start to implement the drawing, so for example, that one liner to work effectively, will need to implement
    handleComponentPosition
    ,
    handleComponentSize
    ,
    applyStyle
    ... and then i just slow ramp up complexity but adding more boxes, nested, autosized etc
  • b

    bright-gpu-74537

    01/13/2023, 7:17 AM
    and yeah, text is certainly going to be the most challenging, the basic way it works in core is haxeui will make a call t "getTextDisplay()", this is a class tree where part of it will live in the backend... and then its up to you to "honour" that text info that core sets, like x, y, text, style etc
  • b

    bright-gpu-74537

    01/13/2023, 7:19 AM
    anyway, lemme know if you get stuck - if you managed to create any notes, that might be super useful for a new section in the guides i dont think writing new backends is common, but its certainly an important part of haxeui, so might be nice to have a guide
  • p

    powerful-morning-89

    01/13/2023, 7:29 AM
    > and yeah, text is certainly going to be the most challenging, the basic way it works in core is haxeui will make a call t "getTextDisplay()", this is a class tree where part of it will live in the backend... and then its up to you to "honour" that text info that core sets, like x, y, text, style etc Piece of advice, if you ever want to support anything fancier than ordinary latin text: use HarfBuzz. (Ie what everyone else already uses)
  • b

    bright-gpu-74537

    01/13/2023, 7:30 AM
    yeah, tbh, generally what haxeui does it uses what the backend framework uses - but with this proposed "gl" or "lime" backend i dont know if thats has its own text stuff
  • p

    powerful-morning-89

    01/13/2023, 7:31 AM
    Lime has harfbuzz bindings.
  • b

    bright-gpu-74537

    01/13/2023, 7:32 AM
    right, maybe this was about raw gl calls then, dunno, but there was a mention above about "text is going to be fun" (as in complex)
  • m

    melodic-advantage-23638

    01/13/2023, 1:01 PM
    Thanks, this is great info. I'll start by taking your advice, Ian, and create a new backend from the skeleton and go from there. I'll ask look at harfbuzz and see how the other backends might be using it.
  • b

    bright-gpu-74537

    01/13/2023, 4:32 PM
    @hallowed-ocean-84954 - long shot here, but im trying to remember why i cancel the mouse over event when showing a tooltip... since i think you use tooltips the most then maybe it was something you found... and recollection? Also, what happens if you comment out this line: https://github.com/haxeui/haxeui-core/blob/master/haxe/ui/tooltips/ToolTipManager.hx#L69 Do your tooltips still work as expected?
  • h

    hallowed-ocean-84954

    01/13/2023, 4:55 PM
    ok one issue I recall is that I have tooltips at two levels in an accordion - and there was a problem with only the top level one appearing not the ones for the sections of the accordion
  • h

    hallowed-ocean-84954

    01/13/2023, 4:55 PM
    I remember reporting that and you tweaked something - might have been this ?
  • h

    hallowed-ocean-84954

    01/13/2023, 4:56 PM
    @bright-gpu-74537 ^
  • b

    bright-gpu-74537

    01/13/2023, 5:00 PM
    ah, yeah, i think thats exactly it
  • b

    bright-gpu-74537

    01/13/2023, 5:00 PM
    thanks for the memory jog 🙂
  • h

    hallowed-ocean-84954

    01/13/2023, 5:01 PM
    no worries
  • r

    refined-greece-48002

    01/14/2023, 11:57 AM
    @bright-gpu-74537 (attached) causes a crash on Heaps when the button is clicked, crashing at line 866 of heaps's h2d/Scene.hx, because the number of layers is larger than the number of children. The old instance 'd' is no longer in children, but the new one 'e' is.
  • r

    refined-greece-48002

    01/14/2023, 11:58 AM
    (CustomDialog is just a vbox containing a dialog containing a button)
  • r

    refined-greece-48002

    01/14/2023, 11:59 AM
    Is this just something I shouldn't be doing? Or is there another bug in Heaps?
  • r

    refined-greece-48002

    01/14/2023, 12:03 PM
    Gist here: https://gist.github.com/kaug-whis/a19886ff3383254a9be3fd3745bcc58b
  • b

    bright-gpu-74537

    01/14/2023, 12:04 PM
    so i dont think you should be adding and removing dialogs from s2d yourself... haxeui handles that, also, whats
    d.dlg
    ?
  • b

    bright-gpu-74537

    01/14/2023, 12:04 PM
    ok, so yeah, looking at the gist you are kinda using dialogs incorrectly
  • b

    bright-gpu-74537

    01/14/2023, 12:05 PM
    in CustomDialog, make it extends Dialog (and not VBox), also update the xml to the same (ie, remove the top level )
1...137213731374...1687Latest