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

    bright-gpu-74537

    06/12/2020, 8:12 AM
    hard to know the best approach
  • b

    bright-gpu-74537

    06/12/2020, 8:12 AM
    (in an efficiency sense)
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:12 AM
    multiple graphics might be better, given the background image can change dynamically through
    style
  • b

    bright-gpu-74537

    06/12/2020, 8:16 AM
    yeah, you could be very right, and it sounds alot easier to implement too
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:16 AM
    where should I look into about this issue?
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:17 AM
    I can try fixing it
  • b

    bright-gpu-74537

    06/12/2020, 8:18 AM
    there is likely a StyleHelper in the haxeui-heaps lib... two secs, lemme confirm that
  • b

    bright-gpu-74537

    06/12/2020, 8:18 AM
    yeah: haxe.ui.backend.heaps.StyleHelper
  • b

    bright-gpu-74537

    06/12/2020, 8:19 AM
    there is the slice 9 stuff there, maybe it all need to be sorted
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:19 AM
    wow this inheritance tree of
    Component
    ...
  • b

    bright-gpu-74537

    06/12/2020, 8:19 AM
    yeah :/
  • b

    bright-gpu-74537

    06/12/2020, 8:19 AM
    the idea was to simplify it as Component was getting HUGE
  • b

    bright-gpu-74537

    06/12/2020, 8:20 AM
    previously all of that code was in Component
  • b

    bright-gpu-74537

    06/12/2020, 8:20 AM
    so the intention was to split it out into smaller chunks
  • b

    bright-gpu-74537

    06/12/2020, 8:20 AM
    the inheritance tree certainly wasnt needed for any reason other than an attempt at "neatness" (not sure if it worked to be honest)
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:21 AM
    the current problem is that
    Component
    extends
    h2d.Graphics
    It is not immediately clear how to use multiple
    Graphics
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:22 AM
    I think using composition instead of inheritance could possibly make it simpler (and easier to test too)
  • b

    bright-gpu-74537

    06/12/2020, 8:22 AM
    yeah, so maybe it could inherit from something else "heaps like" rather than graphics and then add a graphics object to it.... not sure
  • b

    bright-gpu-74537

    06/12/2020, 8:23 AM
    my knowledge of heaps is a 1 out of 100 i would say 😄
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:23 AM
    > I think using composition instead of inheritance could possibly make it simpler (and easier to test too) for example pretty sure
    ComponentEvents
    could be a separate class e.g.
    EventEmitter
    or the like
  • b

    bright-gpu-74537

    06/12/2020, 8:25 AM
    yeah, its a valid point for sure... what happened was at some point months ago i was sick of scrolling through 1000's of lines of code in Component and thought "right" im just going to move some of this out of here!
  • b

    bright-gpu-74537

    06/12/2020, 8:26 AM
    but in reality i moved a few 100 lines out, and arguably made the hierarchy harder to follow :/
  • b

    bright-gpu-74537

    06/12/2020, 8:27 AM
    there is still ALOT i could move out of Component into the base classes to be fair, but i havent done so as im not convinced myself about the change
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:30 AM
    I think heaps 2d is quite like openfl, i.e basically based on a display list/tree
  • b

    bright-gpu-74537

    06/12/2020, 8:31 AM
    it seems fairly similar, yeah
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:31 AM
    and
    h2d.Object
    is the "base" container class
  • b

    bright-gpu-74537

    06/12/2020, 8:31 AM
    right, so maybe it should be an Object with graphics objects added to it?
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:31 AM
    maybe could use that, then "addChild" some
    Graphics
    into it
  • c

    cool-psychiatrist-49311

    06/12/2020, 8:31 AM
    exactly.
  • b

    bright-gpu-74537

    06/12/2020, 8:31 AM
    yeah
1...273274275...1687Latest