HISE Logo Forum
    • Categories
    • Register
    • Login

    Rounded Rectangle / Panel masking?

    Scheduled Pinned Locked Moved Solved Scripting
    13 Posts 4 Posters 50 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.
    • ChazroxC
      Chazrox
      last edited by Chazrox

      I want to clip the corners on these panels so my shadows dont show outside of the rounded corners. I thought maybe masking would help in a way. Is there a way to do this via script? I found 'g.applyMask' but that expects a path im assuming from an SVG image or drawn manually. How can I draw the path manually of a rounded rectangle?

      funky corners
      Screenshot 2025-10-14 at 2.25.17 AM.png

      LindonL ChazroxC 2 Replies Last reply Reply Quote 0
      • LindonL
        Lindon @Chazrox
        last edited by

        @Chazrox use the panels paint method.

        HISE Development for hire.
        www.channelrobot.com

        ChazroxC 1 Reply Last reply Reply Quote 0
        • ChazroxC
          Chazrox @Lindon
          last edited by Chazrox

          @Lindon What do you mean? This is a paintRoutine as it is. I just need to be able to make shadows along the outer edges but I want to mask parts out specifically the corners.

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Chazrox
            last edited by

            @Chazrox Use either addDropShadowFromAlpha() or drawDropShadowFromPath()

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            ChazroxC 1 Reply Last reply Reply Quote 0
            • ChazroxC
              Chazrox @d.healey
              last edited by Chazrox

              @d-healey I used those to make this image for sure. The problem is, if I want the panel to look rounded.....it doesnt clip the corners properly....see the ugly shadows peaking outside my "rounded" rectangle. Screenshot 2025-10-14 at 4.36.48 AM.png

              hence me looking for a masking solution. I tried putting my painted panel into an empty rounded panel and seeing if it would clip the corners but it doesnt.

              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @Chazrox
                last edited by

                @Chazrox There's g.applyMask which you could try.

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                1 Reply Last reply Reply Quote 0
                • ChazroxC
                  Chazrox @Chazrox
                  last edited by

                  @Chazrox said in Rounded Rectangle / Panel masking?:

                  I found 'g.applyMask' but that expects a path im assuming from an SVG image or drawn manually. How can I draw the path manually of a rounded rectangle?

                  @d-healey thats what I was asking about. Know how?

                  d.healeyD It_UsedI 2 Replies Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @Chazrox
                    last edited by d.healey

                    @Chazrox Might help - https://forum.hise.audio/topic/10292/paint-routine-rounded-image/4?_=1760442001101

                    Free HISE Bootcamp Full Course for beginners.
                    YouTube Channel - Public HISE tutorials
                    My Patreon - HISE tutorials

                    ChazroxC 1 Reply Last reply Reply Quote 0
                    • It_UsedI
                      It_Used @Chazrox
                      last edited by It_Used

                      @Chazrox
                      Paint routine:

                      const Path = Content.createPath();
                      Path.addRoundedRectangle(area or local bounds, corner size);
                      g.drawDropShadowFromPath(path, area or local bounds, colour, radius, offset in array 2 elements);
                      

                      and if you want delete inner shadow:

                      const Path = Content.createPath();
                      Path.addRoundedRectangle(area or local bounds, corner size);
                      g.beginLayer(false);
                      g.drawDropShadowFromPath(path, area or local bounds, colour, radius, offset in array 2 elements);
                      g.applyMask(Path, area or local bounds, invert in this case is true);
                      g.endLayer();
                      
                      ChazroxC 1 Reply Last reply Reply Quote 1
                      • ChazroxC
                        Chazrox @d.healey
                        last edited by

                        @d-healey That was definitely the fix! I get how to use it now! 😎 Shall I say "Game Over" hahaha.

                        Clean Corners now...

                        Screenshot 2025-10-14 at 4.56.33 AM.png

                        via GIPHY

                        1 Reply Last reply Reply Quote 2
                        • ChazroxC Chazrox has marked this topic as solved
                        • ChazroxC
                          Chazrox @It_Used
                          last edited by

                          @It_Used Sick. I was just looking over your code. I see whats going on now. I feel like this will help me achieve more of the looks im trying to achieve with inner/outer shadows in specific places.
                          Chee! Thanks! 🙏

                          It_UsedI 1 Reply Last reply Reply Quote 1
                          • It_UsedI
                            It_Used @Chazrox
                            last edited by It_Used

                            @Chazrox i think my example is little incorrect, do not matched to context, i later read your messages, and It looks like you didn't need exactly what I wrote about.
                            This is my mistake, i'm sorry.

                            ChazroxC 1 Reply Last reply Reply Quote 0
                            • ChazroxC
                              Chazrox @It_Used
                              last edited by

                              @It_Used no stress. I'll still try it and see what results it produces. Maybe I can still use it for something. 🤛 Thanks again!

                              1 Reply Last reply Reply Quote 1
                              • First post
                                Last post

                              33

                              Online

                              2.0k

                              Users

                              12.7k

                              Topics

                              110.0k

                              Posts