HISE Logo Forum
    • Categories
    • Register
    • Login

    I can not understad 'int colourId' in 'setColour' from a Label

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

      I can't understand the syntax of:

      'ScriptLabel.setColour(int colourId, int colourAs32bitHex)'
      

      what is the integer colourId?
      I want to set a yellow colour on my label, but it do not trigger:

      lblTempo.setColour(lblTempo.textColour 0xccc8b448);
      

      Can I have an example? I understand it may seem trivial but I can't set the color via scripting

      Free Party, Free Tekno & Free Software too

      Christoph HartC d.healeyD 2 Replies Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @Mighty23
        last edited by

        @Mighty23 just use set:

        ScriptLabel.set("bgColour", Colours.yellow);
        
        1 Reply Last reply Reply Quote 1
        • d.healeyD
          d.healey @Mighty23
          last edited by d.healey

          @Mighty23 I've never used this functions before. Generally to set component properties you just use the set() function and pass in the property name. Like myLabel.set("bgColour", Colours.yellow); etc.

          But looking at the docs, it seems the IDs are specified (BG, IT1, IT2, TXT) - I don't know if these are strings or constants though...

          7b9c66ba-5b13-4e07-8fe8-1cdfc3a7ad0c-image.png

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

          1 Reply Last reply Reply Quote 0
          • M
            Mighty23
            last edited by

            @d-healey , @Christoph-Hart thanks for the solution:

            ScriptLabel1.set("textColour", 0xccc8b448);
            

            Free Party, Free Tekno & Free Software too

            1 Reply Last reply Reply Quote 0
            • M Mighty23 has marked this topic as solved on
            • First post
              Last post

            47

            Online

            1.7k

            Users

            11.7k

            Topics

            101.8k

            Posts