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

    icy-zebra-52882

    08/28/2022, 10:21 AM
    ah I was trying to use aliasing, the guide still mentions you can do it at the end
  • b

    bright-gpu-74537

    08/28/2022, 10:23 AM
    ah, aliasing is gone
  • b

    bright-gpu-74537

    08/28/2022, 10:24 AM
    the way haxeui finds components now is totally different so aliasing wasnt feasible anymore
  • b

    bright-gpu-74537

    08/28/2022, 10:24 AM
    if you really need to use aliasing, you can just create a copy of the component with a different name
    class MyAlias extends MyComponent
  • i

    icy-zebra-52882

    08/28/2022, 10:25 AM
    so if I use module.xml and point it to a class
    MyCustom
    in
    MyCustom.hx
    , do I use
    <import resource="path/to/MyCustom.xml" />
    or
    <mycustom />
    ?
  • b

    bright-gpu-74537

    08/28/2022, 10:29 AM
    just
    <mycustom />
  • b

    bright-gpu-74537

    08/28/2022, 10:29 AM
    haxeui will resolve the classes and when its building code
    <mycustom/>
    will resolve to
    my.component.pkg.MyCustom
    (or whatever it is)
  • b

    bright-gpu-74537

    08/28/2022, 10:32 AM
    (fyi, the just imports one xml file into another, nothing to do with custom components really)
  • i

    icy-zebra-52882

    08/28/2022, 10:34 AM
    I'm trying the module.xml bit and getting this error when trying to use it in a different XML layout:
    Copy code
    source/editor/EditorState.hx:1231: characters 1-8 : Warning : no class found for component: tiletoolbar
    /home/matt/.local/share/haxe/lib/haxeui-core/git/haxe/ui/macros/ComponentMacros.hx:289: characters 70-83 : Unknown identifier : c4
    /home/matt/.local/share/haxe/lib/haxeui-core/git/haxe/ui/macros/ComponentMacros.hx:289: characters 70-83 : ... For function argument 'child'
    source/editor/EditorState.hx:1232: lines 1232-1238 : ... Defined in this class
  • i

    icy-zebra-52882

    08/28/2022, 10:35 AM
    does it still need a
    TileToolbar
    class defined somewhere?
  • b

    bright-gpu-74537

    08/28/2022, 10:35 AM
    can i see your module.xml? Also, where is your module.xml? On the classpath?
  • b

    bright-gpu-74537

    08/28/2022, 10:35 AM
    well, yeah, i mean, what is tiletoolbar?
  • i

    icy-zebra-52882

    08/28/2022, 10:36 AM
    module.xml:
    Copy code
    xml
    <?xml version="1.0" encoding="UTF-8"?>
    <module>
        <components>
            <component file="assets/ui/custom/tile-toolbar.xml" />
            <!-- alternative method for entire package (without aliases)
            <component folder="custom" />
            -->
        </components>
    </module>
  • b

    bright-gpu-74537

    08/28/2022, 10:36 AM
    it will certainly need to resolve to a component for haxeui to know what it is
  • b

    bright-gpu-74537

    08/28/2022, 10:36 AM
    oh, ok, so you are using the "classless" method
  • b

    bright-gpu-74537

    08/28/2022, 10:36 AM
    could be a bug
  • i

    icy-zebra-52882

    08/28/2022, 10:36 AM
    ah yeah sorry, seemed like the easier way to manage over time
  • b

    bright-gpu-74537

    08/28/2022, 10:36 AM
    can you remove the hypen from the .xml file just to see if thats the issue
  • i

    icy-zebra-52882

    08/28/2022, 10:37 AM
    nope, still same error without the hyphen
  • b

    bright-gpu-74537

    08/28/2022, 10:37 AM
    right, feels like a bug
  • i

    icy-zebra-52882

    08/28/2022, 10:37 AM
    tiletoolbar.xml
    is just this:
    Copy code
    xml
    <?xml version="1.0" encoding="UTF-8"?>
    
    <hbox id="tileRow" width="100%" horizontalAlign="center">
        <button height="32px" icon="assets/images/player1_preview.png" />
        <button height="32px" icon="assets/images/player2_preview.png" />
    </hbox>
  • b

    bright-gpu-74537

    08/28/2022, 10:37 AM
    i havent played with the "create a class from xml file" in a bit... maybe i broke it at some point
  • b

    bright-gpu-74537

    08/28/2022, 10:38 AM
    it all seems valid... where is your module.xml file located?
  • b

    bright-gpu-74537

    08/28/2022, 10:39 AM
    is it on a classpath of your project? Ie, probably not your root dir, but like src or something
  • i

    icy-zebra-52882

    08/28/2022, 10:39 AM
    I put it in
    src
    in my flixel project
  • b

    bright-gpu-74537

    08/28/2022, 10:39 AM
    right, should be fine then
  • b

    bright-gpu-74537

    08/28/2022, 10:39 AM
    feels like a bug in the "file" stuff
  • b

    bright-gpu-74537

    08/28/2022, 10:39 AM
    bear with me, ill have a play
  • i

    icy-zebra-52882

    08/28/2022, 10:40 AM
    cheers, thought I was doing it wrong for half of last night 😌
  • b

    bright-gpu-74537

    08/28/2022, 10:40 AM
    seems fine by what you pasted, just trying it out myself
1...122412251226...1687Latest