HISE Forum
    • Unread
    • Recent
    • Admin
    • Register
    • Login

    Colour accent on preset select, laf fix?

    Scheduled Pinned Locked Moved General Questions
    22 Posts 3 Posters 1.4k 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.
    • DanHD
      DanH @d.healey
      last edited by

      @d-healey ah yes just seen in the docs too, thanks!
      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer https://dhplugins.com/ | https://dcbreaks.com/ London, UK
      1 Reply Last reply Reply Quote 0
      • DanHD
        DanH @d.healey
        last edited by

        @d-healey so you're just using that? Mine goes blank, do you not have to specify colours, fonts etc?
        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer https://dhplugins.com/ | https://dcbreaks.com/ London, UK
        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @DanH
          last edited by

          @DanH Yes that's only a tiny bit of the code. ``` presetBrowser.registerFunction("drawPresetBrowserColumnBackground", function(g, obj) { var a = obj.area; if (obj.text == "Add a Bank") obj.text = "Select a Library"; if (obj.text == "Select a Column") obj.text = "Select a Category"; if (a[2] > 300 && obj.text != "") obj.text = "No Results"; g.setColour(style.presetBrowser.columnBg); g.fillRoundedRectangle([a[0], a[1], a[2], a[3]], 10); g.setColour(obj.textColour); g.setFont("bold", 20); g.drawAlignedText(obj.text, a, "centred"); }); ```
          [Free HISE Bootcamp](https://audiodevschool.com/courses/hise-bootcamp/) Full Course for beginners. [YouTube Channel](https://www.youtube.com/@david-healey) - Public HISE tutorials [My Patreon](https://www.patreon.com/davidhealey) - HISE tutorials
          DanHD StraticahS 2 Replies Last reply Reply Quote 0
          • DanHD
            DanH @d.healey
            last edited by

            @d-healey perfect, thanks!
            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer https://dhplugins.com/ | https://dcbreaks.com/ London, UK
            1 Reply Last reply Reply Quote 0
            • StraticahS
              Straticah @d.healey
              last edited by Straticah

              @d-healey can width of the rectangle be written in % of the maximum length? For being responsive? ``` //colour accent g.setColour(0x99ED3237); g.fillRoundedRectangle([a[0], a[1], a[2] - 100, a[3]], {CornerSize: 2, Rounded:[1, 0, 1, 0]}); } ``` 100 in this example
              creating user interfaces: www.vst-design.com founder @prototype.audio https://www.prototype.audio/
              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @Straticah
                last edited by d.healey

                @Straticah Sure, just multiply a[2] by 0.5 for 50%, or 0.75 for 75%, etc.
                [Free HISE Bootcamp](https://audiodevschool.com/courses/hise-bootcamp/) Full Course for beginners. [YouTube Channel](https://www.youtube.com/@david-healey) - Public HISE tutorials [My Patreon](https://www.patreon.com/davidhealey) - HISE tutorials
                StraticahS 1 Reply Last reply Reply Quote 1
                • StraticahS
                  Straticah @d.healey
                  last edited by

                  @d-healey this finally fixed my issue the accent is now the same size on each tab, independent of tab length :) ty for your help. I have learned a lot in only a week.
                  creating user interfaces: www.vst-design.com founder @prototype.audio https://www.prototype.audio/
                  DanHD 1 Reply Last reply Reply Quote 2
                  • DanHD
                    DanH @Straticah
                    last edited by

                    @Straticah snippet! 😂
                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer https://dhplugins.com/ | https://dcbreaks.com/ London, UK
                    StraticahS 1 Reply Last reply Reply Quote 1
                    • StraticahS
                      Straticah @DanH
                      last edited by Straticah

                      @DanH haha i have too much going on in my project to share, maybe this will help? :) ``` //color preset select if(obj.selected) { g.setColour(0x99521F22); g.fillRoundedRectangle(obj.area, 3.0); //red accent g.setColour(0x99ED3237); g.fillRoundedRectangle([a[0], a[1], a[2] / 1000 + 3, a[3]], {CornerSize: 2, Rounded:[1, 0, 1, 0]}); } ``` did you mean that?
                      creating user interfaces: www.vst-design.com founder @prototype.audio https://www.prototype.audio/
                      DanHD 1 Reply Last reply Reply Quote 0
                      • DanHD
                        DanH @Straticah
                        last edited by

                        @Straticah yes, thanks!
                        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer https://dhplugins.com/ | https://dcbreaks.com/ London, UK
                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post