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

    melodic-advantage-23638

    01/25/2023, 10:32 PM
    in the heaps backend at least
  • a

    ambitious-knife-25690

    01/25/2023, 10:33 PM
    haxeuiapp is a convenience thing, not necessary to use haxeui, might be best to figure out the base first
  • a

    ambitious-knife-25690

    01/25/2023, 10:33 PM
    then port that base to haxeuiapp
  • e

    elegant-twilight-61392

    01/25/2023, 10:36 PM
    i think you meant to be in #1059447388047159399 ? lol
  • l

    late-engine-8731

    01/25/2023, 10:36 PM
    oh!
  • l

    late-engine-8731

    01/25/2023, 10:36 PM
    yes, I was to quick 😄
  • e

    elegant-twilight-61392

    01/25/2023, 10:37 PM
    anyways, if you dont have to use
    HaxeUIApp
    , then what is the intended way of creating components without it?
  • e

    elegant-twilight-61392

    01/25/2023, 10:37 PM
    because it might not be an issue
  • a

    ambitious-knife-25690

    01/25/2023, 10:41 PM
    so the way that daz described godot, you'd need to pass things to a render function
  • a

    ambitious-knife-25690

    01/25/2023, 10:41 PM
    looking at the kha setup
  • a

    ambitious-knife-25690

    01/25/2023, 10:41 PM
    Ian has a
    renderTo
    function in there
  • e

    elegant-twilight-61392

    01/25/2023, 10:42 PM
    well i need to render to a
    CanvasItem
    . but i cant just create one and draw on it and have it show up. i have to add that CanvasItem to godots scene tree for it to show up
  • a

    ambitious-knife-25690

    01/25/2023, 10:43 PM
    soz was browsing through kha repo
  • e

    elegant-twilight-61392

    01/25/2023, 10:43 PM
    to get godots scene tree, i have to have a node already though, and unless i give haxeui something, it wont have any way of creating and displaying anything on its own
  • a

    ambitious-knife-25690

    01/25/2023, 10:43 PM
    then it looks like what happens is there's a
    renderTo
    function on the
    screen
    instance which looks pretty simple
  • a

    ambitious-knife-25690

    01/25/2023, 10:43 PM
    Copy code
    hx
        public function renderTo(g:Graphics) {
            var oldColor = g.color;
            g.color = Color.White;
            for (c in rootComponents) {
                c.renderTo(g);
            }
            updateFPS(g);
            g.color = oldColor;
        }
  • a

    ambitious-knife-25690

    01/25/2023, 10:44 PM
    it just tells haxeui to run each components
    renderTo
    function and pass the graphics context to them
  • a

    ambitious-knife-25690

    01/25/2023, 10:44 PM
    then usage is simply calling
    Screen.render(canvasItem)
    as part of your apps init
  • l

    late-engine-8731

    01/25/2023, 10:46 PM
    wait a sec
  • l

    late-engine-8731

    01/25/2023, 10:46 PM
    What is the workflow? I was under the assumption you add your haxeui node to the scene and specify a ui to load
  • a

    ambitious-knife-25690

    01/25/2023, 10:46 PM
    so that's what it looked like in my own kha framework
  • l

    late-engine-8731

    01/25/2023, 10:46 PM
    So you start with a node in the tree which you can draw into
  • l

    late-engine-8731

    01/25/2023, 10:47 PM
    or am i wrong
  • a

    ambitious-knife-25690

    01/25/2023, 10:47 PM
    it would be the same as all backends, the only thing you need to tell haxeui is where to draw to
  • a

    ambitious-knife-25690

    01/25/2023, 10:48 PM
    so that would be the "most" init a user would need to do
  • e

    elegant-twilight-61392

    01/25/2023, 10:49 PM
    you would make a
    class SomeNodeThatCreatesHaxeUIStuff extends Node
    and then do whatever haxeui stuff in there
  • e

    elegant-twilight-61392

    01/25/2023, 10:49 PM
    and then that is the node that you could add to a scene in the editor
  • e

    elegant-twilight-61392

    01/25/2023, 10:50 PM
    i guess its still subject to change right now, but this is one way you might create said class
  • e

    elegant-twilight-61392

    01/25/2023, 10:51 PM
    and then you would add
    HaxeUIRoot
    to a scene
  • e

    elegant-twilight-61392

    01/25/2023, 10:55 PM
    so the problem now is that you dont have to use
    HaxeUIApp
    , you can just create components. but how do i give the component a way to access the scene tree?
1...141014111412...1687Latest