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

    brave-kangaroo-30399

    05/18/2019, 2:28 AM
    So, you could ditch the substate which is likely not a good plan
  • b

    brave-kangaroo-30399

    05/18/2019, 2:29 AM
    Or, and this probably works but maybe is buggy, you set the HaxeUI/flixel container to your substate instead
  • b

    brave-kangaroo-30399

    05/18/2019, 2:30 AM
    I don’t want to force you to create some kind of FlxHaxeUIState that auto does that, so there would have to be some manual effort
  • b

    brave-kangaroo-30399

    05/18/2019, 2:31 AM
    And then you change the container (I’m guessing) using
    Toolkit.screen.options.container = mySubState
  • b

    brave-kangaroo-30399

    05/18/2019, 2:32 AM
    Mm no you set
    options = { container : mySubState }
  • b

    brave-kangaroo-30399

    05/18/2019, 2:33 AM
    I’ll think about if there’s an easier way to do that using signals, though that would be making a lot of assumptions
  • q

    quick-king-64105

    05/18/2019, 5:29 AM
    @brave-kangaroo-30399 ... where
    Playstate.uiGroup
    is an already initialized
    FlxGroup
    ...
    Copy code
    haxe
    Toolkit.init({ container : uiGroup });
    this.add(this.uiGroup);
    var _ui = ComponentMacros.buildComponent("assets/ui/playstate.xml");
    uiGroup.add(_ui);
  • q

    quick-king-64105

    05/18/2019, 5:32 AM
    I did conceive of a few wrokarounds.
  • q

    quick-king-64105

    05/18/2019, 5:32 AM
    One of them was to just create a different playstate
  • q

    quick-king-64105

    05/18/2019, 5:32 AM
    But this is for a player's inventory and simple dialogues so
  • q

    quick-king-64105

    05/18/2019, 5:32 AM
    You can imagine that seems non-ideal.
  • q

    quick-king-64105

    05/18/2019, 5:34 AM
    If your idea works - to change the container - I am curious, is there any reason that a simple subclass of FlxSubstate wouldn't suffice?
  • q

    quick-king-64105

    05/18/2019, 5:34 AM
    On create, sets container to self; on destroy, sets container to parent?
  • b

    brave-kangaroo-30399

    05/18/2019, 6:03 AM
    Container is a FlxGroup so any FlxGroup will work
  • b

    brave-kangaroo-30399

    05/18/2019, 6:04 AM
    I do this when I swap states so I assume it’ll work here
  • q

    quick-king-64105

    05/18/2019, 6:04 AM
    Under the hood, I assume init can only be called once per application.
  • q

    quick-king-64105

    05/18/2019, 6:05 AM
    I hadn't had call to check.
  • b

    brave-kangaroo-30399

    05/18/2019, 6:05 AM
    You’d have to play with it, but HaxeUI also can have multiple UIs that you hide and show as needed
  • b

    brave-kangaroo-30399

    05/18/2019, 6:05 AM
    But yeah play with it and let me know what happens
  • q

    quick-king-64105

    05/18/2019, 6:05 AM
    Hiding and showing is an option for an alternative to full substates.
  • q

    quick-king-64105

    05/18/2019, 6:05 AM
    It seems... anathema.
  • q

    quick-king-64105

    05/18/2019, 6:06 AM
    I guess I mean, it seems to run counter to the notion of flxsubstate, to instead show/hide ui as a substate implementation.
  • q

    quick-king-64105

    05/18/2019, 6:07 AM
    Under what conditions does haxeui ignore input? Any that are easy to set?
  • b

    bright-gpu-74537

    05/18/2019, 6:57 AM
    im not flixel expert, but i would have expected haxeui to be using something like this
  • b

    bright-gpu-74537

    05/18/2019, 6:58 AM
    Main.hx: Toolkit.init() (once) State1.hx: Create ui whateverway, then just add to state (.add) State2.hx: Create ui whateverway, then just add to state (.add) ..
  • b

    bright-gpu-74537

    05/18/2019, 6:59 AM
    is that not something that works? I mean, i guess you could call init over and over again, but i dont think you'd need to seems that you are only doing that to use a different, flixel specific,
    { container : uiGroup }
    ?
  • q

    quick-king-64105

    05/18/2019, 7:00 AM
    State1 can have substate1 which is a child; while substate1 is active, [the rest of] state1 is supposed to be inactive. Typically in Flixel substates are used for pause menus, inventories, etc.
  • q

    quick-king-64105

    05/18/2019, 7:02 AM
    What you seem to be suggesting, on its face, should work. However, it doesn't fit the use case or one of the major, normal behaviors of flixel development.
  • q

    quick-king-64105

    05/18/2019, 7:02 AM
    If HaxeUI can replace pause menus in Flixel - great! There still needs to be some model for pausing the rest of the state while that's in place. Some child of flxsubstate makes the most sense.
  • q

    quick-king-64105

    05/18/2019, 7:03 AM
    The problem I had was that HaxeUI's state1 UI was still active while substate1 is present.
1...293031...1687Latest