HISE Logo Forum
    • Categories
    • Register
    • Login

    Colour accent on preset select, laf fix?

    Scheduled Pinned Locked Moved General Questions
    22 Posts 3 Posters 1.2k 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");
              });
          

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public 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

              building user interfaces in HISE :)
              web: www.vst-design.com

              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.

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public 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.

                  building user interfaces in HISE :)
                  web: www.vst-design.com

                  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?

                      building user interfaces in HISE :)
                      web: www.vst-design.com

                      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

                        14

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        103.2k

                        Posts