https://linen.dev logo
Join Discord
Powered by
# ceramic
  • b

    billowy-waiter-28954

    03/01/2023, 7:15 PM
    Yes
  • o

    orange-van-60470

    03/01/2023, 7:15 PM
    and logic in lots of places
  • a

    ambitious-knife-25690

    03/01/2023, 7:16 PM
    oh, haxeui components have a
    hasEventListener
    api?
  • b

    bright-gpu-74537

    03/01/2023, 7:16 PM
    sure, but even if they didnt you could add one fairly easy (but it does have one)
  • a

    ambitious-knife-25690

    03/01/2023, 7:17 PM
    oh yeah, it could even just use the eventmap setup
  • b

    bright-gpu-74537

    03/01/2023, 7:19 PM
    the problem with it bubbling up is know when to stop, but i guess you cant...
  • a

    ambitious-knife-25690

    03/01/2023, 7:19 PM
    that was my initial concern
  • a

    ambitious-knife-25690

    03/01/2023, 7:19 PM
    because how am I supposed to know that I haven't gone too far in the tree
  • b

    bright-gpu-74537

    03/01/2023, 7:19 PM
    i mean, you could have a component with a handler, then one without, the one with...
  • o

    orange-van-60470

    03/01/2023, 7:19 PM
    Well I will just clarify the point I tried to explain earlier, a composite approach you have Virtual Sprite and that manages the visual structure and the events from them so there is no bubbling up or down. But i will leave it there as it may not be easy in the systems involved.
  • b

    bright-gpu-74537

    03/01/2023, 7:20 PM
    i dont think you can, i would be tempted to say "if it doesnt have a listener" but i dont think that would be right...
  • o

    orange-van-60470

    03/01/2023, 7:21 PM
    in XAML and flash you would bubbling false
  • o

    orange-van-60470

    03/01/2023, 7:21 PM
    so it would go no futher up
  • b

    bright-gpu-74537

    03/01/2023, 7:22 PM
    realistically, its probably not THAT much of an overhead, say you had a tree that was 15 components deep (which i think would be quite rare)... that means you would check 15 times on a user interaction if it needed to redispatch, which most of the time it wouldnt need to...
  • a

    ambitious-knife-25690

    03/01/2023, 7:22 PM
    the events have a pretty simple context so that isn't really possible
  • b

    bright-gpu-74537

    03/01/2023, 7:23 PM
    im sure there is an optimization in there too, but i can think of one off hand
  • a

    ambitious-knife-25690

    03/01/2023, 7:24 PM
    that's okay, i'll see if i can get the mvp going
  • b

    bright-gpu-74537

    03/01/2023, 7:26 PM
    this is your test case, granted, totally contrived and non-sense, in that context: http://haxeui.org/builder/?442de27d
  • a

    ambitious-knife-25690

    03/01/2023, 7:26 PM
    lol
  • b

    bright-gpu-74537

    03/01/2023, 7:26 PM
    but you'll notice depending on which button you click you'll get different traces
  • b

    billowy-waiter-28954

    03/01/2023, 8:51 PM
    This is really a non issue, really
  • b

    billowy-waiter-28954

    03/01/2023, 8:52 PM
    Walking through parents recursively is soooo nothing compared to what Ceramic has to do at every frame to render something on screen heh 😆
  • a

    ambitious-knife-25690

    03/01/2023, 8:52 PM
    the solution mostly works
  • a

    ambitious-knife-25690

    03/01/2023, 8:53 PM
    there's a bit of a bug for some components
  • a

    ambitious-knife-25690

    03/01/2023, 8:53 PM
    but i'm sure this will be solve the issue once i figure out what is actually going wrong with the odd component
  • b

    billowy-waiter-28954

    03/01/2023, 8:53 PM
    ...unless
    hasEventListener()
    is a very expensive and slow method? But it shouldn't right?
  • a

    ambitious-knife-25690

    03/01/2023, 8:53 PM
    it isn't
  • a

    ambitious-knife-25690

    03/01/2023, 8:54 PM
    it's mostly just a map exists check
  • b

    billowy-waiter-28954

    03/01/2023, 8:55 PM
    I see, should be fine then. Well, map access on hxcpp generates garbage, but well it's not like it will walk through hundreds of objects at every frame so it should be negligible
  • b

    billowy-waiter-28954

    03/01/2023, 8:57 PM
    (I avoid using
    Map<K,V>
    in Ceramic internals because of that. Ceramic has its own
    IntMap<V>
    ,
    IntIntMap
    ,
    IntBoolMap
    ,
    IntFloatMap
    implementations instead. Ended up doing this after I spent time profiling the engine with C++ target)
1...909192...124Latest