Forum

    • Register
    • Login
    • Search
    • Categories

    Solved LAF for Momentary Buttons?

    General Questions
    3
    4
    43
    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.
    • clevername27
      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 Hart ustk 3 Replies Last reply Reply Quote 0
      • Christoph Hart
        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
        • ustk
          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)

          I can't help pressing F5 in the forum...

          1 Reply Last reply Reply Quote 1
          • ustk
            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…

            I can't help pressing F5 in the forum...

            1 Reply Last reply Reply Quote 1
            • Topic has been marked as solved  clevername27 clevername27 
            • First post
              Last post

            2
            Online

            1.1k
            Users

            6.8k
            Topics

            62.7k
            Posts