HISE Logo Forum
    • Categories
    • Register
    • Login

    Images fade in on knob turn?

    Scheduled Pinned Locked Moved General Questions
    6 Posts 3 Posters 344 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      johnmike
      last edited by

      Question of the day…possible to make a few images fade onto interface as I’m turning a knob? Like if knob is zero the interface is clear…but one image could “fade in” at 25% another at 50% and a 3rd at 100%…webview? Lottie animations?

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @johnmike
        last edited by

        @johnmike that can be doable with some math trickery and setting the alpha channel of an image. If you want a head-start, you can look at the C++ code of the scriptnode xfader logic classes as they do pretty much the thing you want, then try to hack that back into working HiseScript code.

        Link Preview Image
        HISE/hi_dsp_library/dsp_basics/logic_classes.h at d3f364f5c2832770a8bade634607e0f70b55f9df · christophhart/HISE

        The open source framework for sample based instruments - HISE/hi_dsp_library/dsp_basics/logic_classes.h at d3f364f5c2832770a8bade634607e0f70b55f9df · christophhart/HISE

        favicon

        GitHub (github.com)

        Bonus trick from my sleeve of undocumented HISE cheats: if you want to do this with a single panel, you can set the colour before drawing an image and it will pickup the alpha value from the colour to set the transparency.

        const var Panel1 = Content.getComponent("Panel1");
        
        Panel1.loadImage("{PROJECT_FOLDER}myImage.png", "img");
        
        Panel1.setPaintRoutine(function(g)
        {
        	g.setColour(Colours.withAlpha(Colours.black, Math.random()));
        	g.drawImage("img", this.getLocalBounds(0), 0, 0);
        });
        
        d.healeyD J 2 Replies Last reply Reply Quote 2
        • d.healeyD
          d.healey @Christoph Hart
          last edited by

          @Christoph-Hart said in Images fade in on knob turn?:

          Bonus trick from my sleeve of undocumented HISE cheats

          Pretty sure i showed this in a video too

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          J 1 Reply Last reply Reply Quote 0
          • J
            johnmike @d.healey
            last edited by

            @d-healey which video? I’ll go check it out!

            1 Reply Last reply Reply Quote 0
            • J
              johnmike @Christoph Hart
              last edited by

              @Christoph-Hart thanks! Will definitely check that out!

              1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey
                last edited by

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post

                48

                Online

                1.7k

                Users

                11.7k

                Topics

                101.9k

                Posts