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

    refined-greece-48002

    04/22/2023, 11:07 AM
    that would more than solve it for my use case, at least :)
  • b

    bright-gpu-74537

    04/22/2023, 11:46 AM
    alright, latest core and haxeui-heaps support middle up / down / click
  • b

    bright-gpu-74537

    04/22/2023, 11:46 AM
    Copy code
    haxe
            this.registerEvent(MouseEvent.MOUSE_DOWN, (event) -> {
                trace("left", event.data);
            });
    
            this.registerEvent(MouseEvent.RIGHT_MOUSE_DOWN, (event) -> {
                trace("right", event.data);
            });
    
            this.registerEvent(MouseEvent.MIDDLE_MOUSE_DOWN, (event) -> {
                trace("middle", event.data);
            });
  • b

    bright-gpu-74537

    04/22/2023, 11:47 AM
    the button will also be passed down in the .data prop, meaning that if you have dunno 4 buttons you will get a "MOUSE_DOWN" (rather than RIGHT_DOWN) and the .data prop will be the button
  • b

    bright-gpu-74537

    04/22/2023, 11:48 AM
    ie, in haxeui-heaps:
  • b

    bright-gpu-74537

    04/22/2023, 11:48 AM
    Copy code
    haxe
                    var type = switch(button) {
                        case 0: haxe.ui.events.MouseEvent.MOUSE_DOWN;
                        case 1: haxe.ui.events.MouseEvent.RIGHT_MOUSE_DOWN;
                        case 2: haxe.ui.events.MouseEvent.MIDDLE_MOUSE_DOWN;
                        case _: haxe.ui.events.MouseEvent.MOUSE_DOWN;
                    }
  • r

    refined-greece-48002

    04/22/2023, 12:56 PM
    @bright-gpu-74537 Perfect, it works exactly as expected!
  • r

    refined-greece-48002

    04/22/2023, 12:56 PM
    Thank you very much
  • r

    refined-greece-48002

    04/22/2023, 2:42 PM
    Another question: Is there a way to make a button's icon scale to the size of the button? At the moment if you make the button smaller than the icon, the icon just bursts out of the button. Being able to apply scaleMode to it like you would an image, eg iconScaleMode, or something, would be pretty handy
  • b

    bright-gpu-74537

    04/22/2023, 3:24 PM
    i think this has come up before, do you have an example of what you mean, just so were talking about the same thing
  • h

    helpful-boots-41914

    04/22/2023, 3:32 PM
    In example, if you supply the icon of a button as an image it won't scale to fit inside the button. But if you put an image inside of a button component, and set its width and height equal to the button, it will scale the image to fit inside the button. @bright-gpu-74537
  • h

    helpful-boots-41914

    04/22/2023, 3:32 PM
    At least that's my experience
  • r

    refined-greece-48002

    04/22/2023, 4:18 PM
    http://haxeui.org/builder/?d1421212 In this case I'd like to be able to set it such that the icon maintains its aspect ratio with its height being set to the height of the button minus the button's internal padding
  • b

    bright-gpu-74537

    04/22/2023, 4:20 PM
    oh, thats fun - defo a bug / oversight
  • b

    bright-gpu-74537

    04/22/2023, 4:21 PM
    for now you can do: http://haxeui.org/builder/?f6ba9801
  • b

    bright-gpu-74537

    04/22/2023, 4:21 PM
    its certainly not ideal, but might suffice until i get round to it
  • r

    refined-greece-48002

    04/22/2023, 4:23 PM
    Cheers! That should work for me for now, as my button heights are known/knowable in this layout
  • b

    bright-gpu-74537

    04/22/2023, 4:23 PM
    cool - but ill defo fix that, its certainly not intentional
  • a

    ambitious-knife-25690

    04/22/2023, 4:29 PM
    it looks like a belt
  • a

    ambitious-knife-25690

    04/22/2023, 11:01 PM

    https://cdn.discordapp.com/attachments/565569107701923852/1099470139004551198/gif.gif▾

  • a

    ambitious-knife-25690

    04/22/2023, 11:02 PM
    i was curious if hashlink's hotreload could reload haxeui layouts
  • a

    ambitious-knife-25690

    04/22/2023, 11:02 PM
    aaaand it doesn't appear like it can :(
  • a

    ambitious-knife-25690

    04/22/2023, 11:02 PM
    it recognises a change, but nothing updates
  • a

    ambitious-knife-25690

    04/22/2023, 11:04 PM
    should have asked about hashlink's hotreload ability during the haxeup
  • a

    ambitious-knife-25690

    04/22/2023, 11:55 PM
    Is there any logic in haxeui that would "include" hscript under any circumstance?
  • r

    refined-greece-48002

    04/23/2023, 3:43 AM
    It does hot reload them, but you'll need to rebuild your ui at runtime manually
  • r

    refined-greece-48002

    04/23/2023, 3:43 AM
    For the same reason that changing something in an init function won't make it have an effect when hot reloaded
  • r

    refined-greece-48002

    04/23/2023, 3:45 AM
    But also there is only so much you can do with this because a lot of haxeui xml changes will add or remove properties, it seems, which will make it say it couldn't JIT the changes
  • f

    full-journalist-82607

    04/23/2023, 6:16 AM
    Do you use macros to load the xml ? Maybe it could be possible if you don't ? I don't know, never really used hashlik ...
  • b

    bright-gpu-74537

    04/23/2023, 7:47 AM
    im not sure how hot reloading works, but i guess there would need to be some haxeui changes to sort of say "start again", no?
1...164216431644...1687Latest