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

    best-agent-85158

    08/29/2022, 11:41 AM
    do you use haxe 4.1 and below?
  • b

    best-agent-85158

    08/29/2022, 11:41 AM
    this uses module level fields...
  • b

    best-agent-85158

    08/29/2022, 11:42 AM
    lemme fix this real quick
  • b

    bright-gpu-74537

    08/29/2022, 11:42 AM
    ah, ill need to set my version, but im half way though something at the moment
  • b

    best-agent-85158

    08/29/2022, 11:42 AM
    oh ok
  • b

    best-agent-85158

    08/29/2022, 11:42 AM
    how do ii check haxe version?
  • b

    bright-gpu-74537

    08/29/2022, 11:43 AM
    you mean at compile time?
  • b

    best-agent-85158

    08/29/2022, 11:43 AM
    yea
  • b

    best-agent-85158

    08/29/2022, 11:43 AM
    h
  • b

    bright-gpu-74537

    08/29/2022, 11:44 AM
    #if haxe_ver > version("0.0.0")
    or something like that
  • b

    bright-gpu-74537

    08/29/2022, 11:46 AM
    in your reposition you are creating a dropdown each time
    dropdown = new DropDown();
  • b

    bright-gpu-74537

    08/29/2022, 11:46 AM
    also, does .left / .top work with repositioning it rather than .x / .y
  • b

    best-agent-85158

    08/29/2022, 11:47 AM
    thats a major oopsie lol
  • b

    best-agent-85158

    08/29/2022, 11:50 AM
    thanks for the help! things work now 🙂
  • b

    bright-gpu-74537

    08/29/2022, 11:51 AM
    np - 👍
  • f

    future-iron-61487

    08/30/2022, 12:40 AM
    wait
  • f

    future-iron-61487

    08/30/2022, 12:41 AM
    is there any time when people /don't/ deal with images as an array of 32-bit unsigned ints?
  • b

    bulky-exabyte-6537

    08/30/2022, 2:54 AM
    is there a way to trigger an animation when my label text changes?
  • b

    bulky-exabyte-6537

    08/30/2022, 2:54 AM
    (the idea is to notify the user that the text changed)
  • b

    bulky-exabyte-6537

    08/30/2022, 2:58 AM
    im guessing it cant be done with pure css
  • b

    bulky-exabyte-6537

    08/30/2022, 4:26 AM
    cant figure out this animation api on the codeside
  • b

    best-agent-85158

    08/30/2022, 6:11 AM
    Try customStyle
  • b

    bulky-exabyte-6537

    08/30/2022, 7:00 AM
    well im trying to access the animation that i created in the css so i can run it manually
  • b

    bulky-exabyte-6537

    08/30/2022, 7:00 AM
    customStyle doesnt have animations
  • b

    bulky-exabyte-6537

    08/30/2022, 7:03 AM
    Copy code
    css
    .highlight-change {
        animation: unhighlight 1s linear 0s 1;
    }
    
    @keyframes highlight {
        100% {
            color: red;
        }
    }
    
    @keyframes unhighlight {
        100% {
            color: $normal-text-color;
        }
    }
    the animation fyi
  • b

    bulky-exabyte-6537

    08/30/2022, 7:04 AM
    i must be misunderstanding animations
  • b

    bright-gpu-74537

    08/30/2022, 7:09 AM
    ok, so to run the animation you need to add the "highlight-change" to a component
  • b

    bright-gpu-74537

    08/30/2022, 7:10 AM
    ie,
    addClass("highlight-change")
  • b

    bright-gpu-74537

    08/30/2022, 7:31 AM
    btw, im thinking about creating an AnimationUtil (that i use in other projects), since css animations can be a real drag some times
  • b

    bright-gpu-74537

    08/30/2022, 7:32 AM
    Copy code
    haxe
    class AnimationUtil {
        public static function shake(c:Component, onComplete:Void->Void = null) {
            var k1 = new AnimationKeyFrame();
            k1.time = Value.VDimension(Dimension.PERCENT(0));
            var directive = new Directive("left", Value.VDimension(Dimension.PX(c.left)));
            k1.directives = [directive];
    
            var k2 = new AnimationKeyFrame();
            k2.time = Value.VDimension(Dimension.PERCENT(20));
            var directive = new Directive("left", Value.VDimension(Dimension.PX(c.left - 5)));
            k2.directives = [directive];
            
            var k3 = new AnimationKeyFrame();
            k3.time = Value.VDimension(Dimension.PERCENT(40));
            var directive = new Directive("left", Value.VDimension(Dimension.PX(c.left + 5)));
            k3.directives = [directive];
            
            var k4 = new AnimationKeyFrame();
            k4.time = Value.VDimension(Dimension.PERCENT(60));
            var directive = new Directive("left", Value.VDimension(Dimension.PX(c.left - 3)));
            k4.directives = [directive];
            
            var k5 = new AnimationKeyFrame();
            k5.time = Value.VDimension(Dimension.PERCENT(80));
            var directive = new Directive("left", Value.VDimension(Dimension.PX(c.left + 3)));
            k5.directives = [directive];
    
            var k6 = new AnimationKeyFrame();
            k6.time = Value.VDimension(Dimension.PERCENT(100));
            var directive = new Directive("left", Value.VDimension(Dimension.PX(c.left)));
            k6.directives = [directive];
            
            var framesArray:Array<AnimationKeyFrame> = [k1, k2, k3, k4, k5, k6];
            
            var frames = new AnimationKeyFrames("shake", framesArray);
            c.applyAnimationKeyFrame(frames, {
                duration: .1
            });
            c.onAnimationEnd = function(e) {
                c._componentAnimation = null;
                if (onComplete != null) {
                    onComplete();
                }
            }
        }
    }
1...123312341235...1687Latest