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

    billowy-easter-22196

    02/07/2023, 5:34 PM
    Hey everyone! I have following code (see screenshot). soo... My problem related to haxeui-heaps. Im trying to add simple button to the scene. The problem is, that haxeui-heaps seems to taking whole scene and shadowing any other elements and scene. This hapens without root object
    o
    too. (only
    Toolkit.init()
    ). It seems like its same behaviour for both scenarios. i understand the logic correct, code above should render button on (100, 200) and not take whole scene. If i comment whole app.ready call, i become the following error and my scene is back. ofcourse, without any button. so this may help localize the bug, i think, something goes wrong after ready callback is executed.
    Copy code
    this._onReady is not a function
        at haxe_ui_HaxeUIApp.onHeapsInit (AppImpl.hx:43:9)
        at haxe_ui_backend__$AppImpl_HeapsApp.init (AppImpl.hx:12:13)
        at App.hx:148:4
        at haxe_ui_backend__$AppImpl_HeapsApp.loadAssets (App.hx:176:3)
        at haxe_ui_backend__$AppImpl_HeapsApp.setup (App.hx:146:3)
        at t.run (Timer.hx:144:4)
        at Timer.hx:73:39 ........
  • b

    bright-gpu-74537

    02/07/2023, 5:38 PM
    addChild is heaps call, not a haxeui call, what if you changed it to
    vbox.addComponent
    ... also i presume you are using git version of everything ?
  • b

    billowy-easter-22196

    02/07/2023, 5:44 PM
    that the funniest thing... Button is here with addChild and with vbox.addComponent, no difference at all. At the moment i was on haxelib version. I installed now everything from git and now im getting error on compile.
    Copy code
    C:\HaxeToolkit\haxe\lib\haxeui-heaps/git/haxe/ui/backend/AssetsImpl.hx:80: lines 80-83 : { name : String, data : hxd.res.BitmapFont } has extra field name
    C:\HaxeToolkit\haxe\lib\haxeui-heaps/git/haxe/ui/backend/AssetsImpl.hx:80: lines 80-83 : ... For function argument ''
    C:\HaxeToolkit\haxe\lib\haxeui-heaps/git/haxe/ui/backend/TextDisplayImpl.hx:43: characters 57-61 : haxe.ui.assets.FontInfo has no field name
    C:\HaxeToolkit\haxe\lib\haxeui-heaps/git/haxe/ui/backend/AppImpl.hx:27: characters 9-27 : Unknown identifier : _autoHandlePreload
    C:\HaxeToolkit\haxe\lib\haxeui-heaps/git/haxe/ui/backend/AppImpl.hx:48: characters 13-25 : Unknown identifier : startPreload
  • b

    bright-gpu-74537

    02/07/2023, 5:45 PM
    so i think you need latest heaps too... and hlsdl and a few other things maybe
  • b

    billowy-easter-22196

    02/07/2023, 5:45 PM
    i just installed it...
  • b

    bright-gpu-74537

    02/07/2023, 5:45 PM
    and git haxeui-core and git haxeui-heaps
  • b

    billowy-easter-22196

    02/07/2023, 5:45 PM
    and this too...
  • b

    bright-gpu-74537

    02/07/2023, 5:46 PM
    maybe a vscode cache issue...
  • b

    billowy-easter-22196

    02/07/2023, 5:46 PM
    nope, even fresh run shows error.
  • b

    bright-gpu-74537

    02/07/2023, 5:49 PM
    well, "name" is certainly there, so you must have not upgraded something... or haxelib git screwed something up: https://github.com/haxeui/haxeui-core/blob/master/haxe/ui/assets/FontInfo.hx
  • b

    bright-gpu-74537

    02/07/2023, 5:50 PM
    fixed
  • b

    billowy-easter-22196

    02/07/2023, 5:54 PM
    so, well, i removed every lib and installed it newly, seems like haxelib is screwed, the issue with compile is fixed. but the issue with scene overtake isnt fixed, addComponent makes no changes too.
  • f

    full-journalist-82607

    02/07/2023, 6:10 PM
    I think it's because when you update git by haxelib it's set the used version of haxeui-core to 1.5. So if you installcore git then heaps git, it doesn't work ( without setting it), but if you install heaps then core it works. The good thing is to check with haxelib list which version is used. So when you update it is simpler to do a simple git pull.
  • b

    bright-gpu-74537

    02/07/2023, 6:12 PM
    ok, so issue isnt fixed, can you send over a minimal repro just to make sure i understand exactly whats going on?
  • b

    billowy-easter-22196

    02/07/2023, 6:15 PM
    Good,i will do this soon. I hope I will get working repro, otherwise it's very.. Dumb
  • b

    bright-gpu-74537

    02/07/2023, 6:15 PM
    i know other people here use haxeui-heaps, and afaik, they dont have issues
  • b

    billowy-easter-22196

    02/07/2023, 6:16 PM
    Weird. Well, I try to send repro asap. Will see...
  • c

    clever-yak-82528

    02/07/2023, 7:06 PM
    My project is going great
  • c

    clever-yak-82528

    02/07/2023, 7:06 PM
    So far I've had exactly one weird memory issue and it turns out I was accidentally calling the destructor when I shouldn't have been
  • b

    billowy-easter-22196

    02/07/2023, 8:01 PM
    @bright-gpu-74537 sent you in DM repro.
  • b

    bright-gpu-74537

    02/07/2023, 8:08 PM
    rcv'd... ok, so the problem here is that you are trying to use a HaxeUIApp and your own App, this effectively means that there are two heaps apps running (one over the top of the other)... And this is what i think is causing strange behaviour, the solution is to just not use a HaxeUIApp (its a helper class, not an essential thing):
  • b

    billowy-easter-22196

    02/07/2023, 8:10 PM
    Hm... i just followed wiki info. (its pretty short, but still) Should i just extend from HaxeUiApp instead of heaps App?
  • b

    bright-gpu-74537

    02/07/2023, 8:10 PM
    Copy code
    haxe
    Toolkit.init({
        root: s2d
        //manualUpdate: true
    });
    
    var vbox = new VBox();
    vbox.styleString = "background-color: red;padding: 5px;";
    vbox.top = 350;
    var btn = new Button();
    btn.text = "Click me!";
    btn.onClick = (_) -> btn.text = "Thanks!";
    
    vbox.addComponent(btn);
    Screen.instance.addComponent(vbox);
  • b

    bright-gpu-74537

    02/07/2023, 8:11 PM
    s2d.add(vbox);
    also works
  • b

    bright-gpu-74537

    02/07/2023, 8:12 PM
    well, just dont use HaxeUIApp at all... its not required, especially when you are trying to integrate haxeui with an exising heaps app... HaxeUIApp is basically just a helper to setup a bunch of things for a "only haxeui" application type project
  • b

    bright-gpu-74537

    02/07/2023, 8:12 PM
    which wiki btw?
  • b

    billowy-easter-22196

    02/07/2023, 8:13 PM
    oh i see.... i had code snippet with Screen.instance.something... from older version of HaxeUi as i first found it month or two ago, but i thought this way is gone now since its updated.
  • b

    billowy-easter-22196

    02/07/2023, 8:13 PM
    https://github.com/haxeui/haxeui-heaps
  • b

    bright-gpu-74537

    02/07/2023, 8:14 PM
    yeah, thats probably a little outdated, i mean, its still valid, but yeah, in your specific case you want to add haxeui and you already have an app etc init'd
  • b

    billowy-easter-22196

    02/07/2023, 8:14 PM
    yes i understand the issue now. just was little bit strange to see this behaviour. Very big thanks for help 😄
1...147714781479...1687Latest