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

    elegant-twilight-61392

    01/25/2023, 8:31 PM
    does my thought process make any sense? lol
  • b

    bright-gpu-74537

    01/25/2023, 8:32 PM
    yeah, i guess that makes sense, but either way, you'll need to implement, at the very least, basic composite containers for size, position, maybe bg/border (if you wanted that)
  • b

    bright-gpu-74537

    01/25/2023, 8:32 PM
    yeah, backends are just modules, and modules can do anything, including defining components
  • e

    elegant-twilight-61392

    01/25/2023, 8:33 PM
    so i shouldnt map a haxeui vbox to a godot vbox then? 🤔
  • b

    bright-gpu-74537

    01/25/2023, 8:33 PM
    i think so, i do think you are underestimating how much work a native backend is - they are certainly the more challenging backends - auto sizing, behaviour overriding, init sequences, etc...
  • b

    bright-gpu-74537

    01/25/2023, 8:34 PM
    you could but there might not be a godot eqiiv for each layout, a better idea would be to map it to a composite container (ie, whatever is a godots UI "base", like a drawing surface or something)
  • b

    bright-gpu-74537

    01/25/2023, 8:35 PM
    then vbox / hbox / grid /x can just be a composite, and the components inside them can be native (native to godot)
  • b

    bright-gpu-74537

    01/25/2023, 8:36 PM
    i guess technically, all native backends are actually hybrids since they use composite and native components - its just that composites are mainly used for layout containers
  • b

    bright-gpu-74537

    01/25/2023, 8:38 PM
    i think you are probably trying to run before you walk... before trying to map anything you should get a 100x100 red box showing... then a 50x50 blue box inside that, etc...
  • b

    bright-gpu-74537

    01/25/2023, 8:38 PM
    if you dont want to map input, then dont... but you'll still need to honour basic layout in your haxeui backend... so as NB said, handleSize, handlePosition, etc
  • e

    elegant-twilight-61392

    01/25/2023, 8:41 PM
    well tbf i was trying to get the
    main.xml
    layout from the skeleton test app to work, starting with its root
    vbox
    element
  • b

    bright-gpu-74537

    01/25/2023, 8:42 PM
    right, but you are looking to map it to something in godot right away, and thats not the right way... you should first just get that skeleton working (with whatever the equiv of godots "sprite" is)
  • l

    late-engine-8731

    01/25/2023, 8:42 PM
    @elegant-twilight-61392 dont worry about input, you'd just add all input callback in your root-node and forward it to hxui
  • l

    late-engine-8731

    01/25/2023, 8:43 PM
    ("hxui" sounds soo much cooler, btw)
  • l

    late-engine-8731

    01/25/2023, 8:43 PM
    go composite
  • b

    bright-gpu-74537

    01/25/2023, 8:44 PM
    dont forgot also pan, there is no reason you cant have a fully hybrid UI also, that is mix and match composite and native components in the same app... but i, personally would advise to start with composite and work your way up to native after
  • l

    late-engine-8731

    01/25/2023, 8:44 PM
    and disable the input depending on mouse enter / exit
  • e

    elegant-twilight-61392

    01/25/2023, 8:44 PM
    so i could just make it fully composite to start, and then map certain things to godot nodes, right?
  • l

    late-engine-8731

    01/25/2023, 8:44 PM
    yep
  • b

    bright-gpu-74537

    01/25/2023, 8:45 PM
    yeah, and you can do things like
    <button native="true" />
    which means it will try and use a native version rather than a composite
  • b

    bright-gpu-74537

    01/25/2023, 8:46 PM
    in fact, the start of any native backend is
    * { native: true; }
    in a main.css file 😉
  • e

    elegant-twilight-61392

    01/25/2023, 8:48 PM
    so i guess ill start with getting the skeleton test app to render to a single godot
    CanvasItem
  • e

    elegant-twilight-61392

    01/25/2023, 8:48 PM
    have to have something to draw on
  • b

    bright-gpu-74537

    01/25/2023, 8:49 PM
    sounds like a sensible attack plan, once you have a few nested boxes, maybe a few layouts tested and working for good measure, then you can decide if you want to go the fully native route - you'll also be in a better position to understand what that entails
  • b

    bright-gpu-74537

    01/25/2023, 8:50 PM
    as @ambitious-knife-25690 will attest to, once you link things up and get them working, things just sort of all fall into place (thats NOT the case with native backends though)
  • b

    bright-gpu-74537

    01/25/2023, 8:50 PM
    but to start with defo go with the "baby steps" approach
  • m

    melodic-advantage-23638

    01/25/2023, 8:59 PM
    Geeze did @ambitious-knife-25690 get a backend working quickly? Lol I'm still slogging along
  • e

    elegant-twilight-61392

    01/25/2023, 9:01 PM
    ok so new question. in haxeui-openfl it renders to an openfl
    Sprite
    . but where does it actually get or create one? i assume i need to do something similar with a godot
    CanvasItem
    , or maybe im starting in the wrong place again lol
  • b

    bright-gpu-74537

    01/25/2023, 9:03 PM
    so you have two options, you can either use composition and have a member on ComponentImpl, like
    var _theCanvas:CanvasItem
    or you can use "ComponentSurface"... this is at the very root of the inheritance tree and lives in the backend, so you can make that the root of all components
  • b

    bright-gpu-74537

    01/25/2023, 9:03 PM
    eg: https://github.com/haxeui/haxeui-openfl/blob/master/haxe/ui/backend/ComponentSurface.hx
1...140814091410...1687Latest