HISE Logo Forum
    • Categories
    • Register
    • Login

    LAF for Momentary Buttons?

    Scheduled Pinned Locked Moved Solved General Questions
    4 Posts 3 Posters 168 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.
    • clevername27C
      clevername27
      last edited by

      When I set a button to momentary, the colours change. How do you set the LAF for the momentary states of a button? Thank you.

      Christoph HartC ustkU 3 Replies Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @clevername27
        last edited by

        @clevername27 Check the obj passed into the function, there are multiple state bools that you can use (down, over, valueNormalized).

        1 Reply Last reply Reply Quote 2
        • ustkU
          ustk @clevername27
          last edited by

          @clevername27 There's no isMomentary property in the LAF object so you need an external variable to get it

          reg isMomentary = button.get("isMomentary");
          

          And draw your custom LAF accordingly.
          Though keep in mind that using external variables in a custom LAF has never been recommended, although Christoph recently said that a safety was introduced so it shouldn't be an issue. At you own risk :)

          Solution 2:
          Just make 2 custom LAF and assign them dynamically (I've never tried)

          Can't help pressing F5 in the forum...

          1 Reply Last reply Reply Quote 1
          • ustkU
            ustk @clevername27
            last edited by

            @clevername27 @Christoph-Hart I might not have understood the question correctly if it's just for the clicking state then…

            Can't help pressing F5 in the forum...

            1 Reply Last reply Reply Quote 1
            • clevername27C clevername27 has marked this topic as solved on
            • First post
              Last post

            57

            Online

            1.7k

            Users

            11.7k

            Topics

            102.1k

            Posts