Macro LAF / Paint Routines help



  • Hi guys, a little help needed with paint routines if possible.

    I was hoping to have different coloured squares for each macro control, and tried to use the same system for naming them (array).

    Didn't work 😂

    Any guidance would be massively appreciated 🙂

    ///////////////  MACROS //////////////
    
    Engine.setFrontendMacros(["LFO1", "LFO2", "STEPPER", "MACRO 1"]);
    laf.registerFunction("drawNumberTag", function(g, obj)
    {
        var coloursmacros = [0x68E903D9, 0xFF006868, 0xAAFFCA00, 0xFF7B7B7B];
        obj.area[0] += obj.area[2] - 15;
        obj.area[1] += 0;
        obj.area[2] = 14;
        obj.area[3] = 14;
        
        //g.setColour(0xFF006868);
        g.fillRoundedRectangle(coloursmacros[obj.macroIndex], obj.area, 4);
        g.setColour(0x73D6D6D6);
        g.drawRoundedRectangle(obj.area, 4, 2);
        
        var letters = ["1", "2", "S", "M1"];
        
        g.drawAlignedText(letters[obj.macroIndex], obj.area, "centred");
    });
    


  • @DanH said in Macro LAF / Paint Routines help:

    [obj.macroIndex]
    check if this exist?



  • @ulrik It seems to as it works perfectly for the names at the bottom...



  • @DanH Hm.. I've never worked with macros before, do you have a snippet?



  • @ulrik Yup 🙂 I've commented out the lines which give errors

    HiseSnippet 1227.3oc4XstaaaCEVxNpqwstXEX.CX+hv+xFy0QxIwMEAAKWrcgQaRLhyJFPPP.iDsLWjIMjnSrQQeB1ivdo1ixdC1NTTxRNUyyKHccoSAvQ7bg76bH44h55ysIAAbeM8UOc5Hhl9SM5MkIFbv.Lko0ool9yLNDGHH9HEo8mNBGDPbzz0y+ZIA8UWQK742+g8wdXlMIgjl163TaxaoCohDpc28MTOu1XGxozgojdic6XyYGv83iA7j2vTaD19JrK4HrTrbFZ5OpkCUv86IvBRfl9J6ycl1a.+FlR92QCnW5QjCrz5ASjhbatmiDwx20NX.0yoarcGnooazMwKjW4E9FiCoNzYzS7FecHCThFo8G54VD7rtivSOE7VQAumazy1mNRjvQhsmXzgAaT8wvVPZXojUK2uj23.NHASTaH9JRaeXvLMJ2vzrJZSSyJaWr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tGigxh4hVHrzrMrfW832DSc.0cPLYJ6ZnCm3OiDzLrCm4MMZWKCKo98ukX8WXI0+jYI4LVjU7kuvxxh2arfOTULGPnaqvVe00awvvc4vfAZ+Ifcufsy
    


  • There is a quete in my native Language Which Says:
    By spending money, you will get Poorer
    But by spreading the Knowledge You will Become Richer 👏
    @DanH @ulrik God bless You Guys, God Bless You Hise Community, I See millionaires Here Everyday 👏



  • @DanH Try this
    There were a wrong line in there, this one:

    //g.fillRoundedRectangle(coloursmacros[obj.macroIndex], obj.area, 4);
    
    HiseSnippet 1213.3oc4X0saaaCElxNJqwqtXEX.CXWQ3qrwbSjbRbSQPP9y1EFsIwnNqX.AYYLRz1bQlzShNwFEEXuJ6MY2t61ivdD1av1ghRQxtIYt.Ka0sx.1lm+32gGxCOG0xW3PCBD9HikNd7.Jx3glsGyk81uGgwQMqgLdj4Aj.I0GqIs23Ajf.pKxvH6yUDLVZAT3yet8dDOB2glPBgdsf4PeIqOSlPs0Nuf440f3ROl0OkzqsSSGAeegmXHfmrlVnADmKHcoGRThkwDYrXcWlT32VRjz.jwB6IbG2tm3JtV9WyBXm6QUCrQsACoI2P34pPrhJZ+dLO2Vw9c.BYX1JYUHqdU3KMOf4xtldxpwWDx.mnQ50CiL2E7rSCOqYGdFof2BZ38Xy1N9rAxDNJr84lM4PfpCABAogkVVTleJq49BPBtb49jKnM7gAWqQwpVVkwqaYUZy74fvPfDeIwG6Q5f2BWm2kwoK63SAG64dhyIdZi9Rg3hc4tMnTuhJEWYxGL9fc2+UG0FOI474xmKxjATYHNnb2CHN9hfhmT.zwtPYr52JENUYV.EK6S6xT6CaLj6HYBdwBt9jqNbX+yo9GS5BJzIlS2xXw4+Xo74dS9bX3Q+MPZYB3AmXcJ9a1JYXkSwOAau9lSIkcnTVSSFjdKr8ZSSd0IHq+Vs94DtaNnenuAhbh0npaT+YVqV6YkwViZzvxp5FU23zHEWYktpkD8YfhI7KEwOM2IL8IJjD92lbW5nSSTnCbV6Uhg.U2WQcjDdWOZwXbWFu1MYZqQOc0ZUUeR3pVsuK6TFWoz639dTIDxBc7BgwTHfNgPZ6tqGqKm5dLcjrXjJS6PkwIyUAGXOrO0sfZBeaoMiC7XA+PgjdDuXobuI2R4daN7zr5z4F4oNW3K77n92HaUdJ+6Rwh7v8gkAm1aH8ZAgCrSlQv71yHjNgki9XZJAE7lbl7nAT9skm.Ec1FxXjIBUfnxv7EOJJeQaOlK0GwfzBel4K3hysQg.NJG7Ou2u7GailYkqLgx+pakeaaz21rFQRTYshfC.wATeIS48F0nWBWGnygsjYMZvERwfP71effq.uwB+iHdTxMFe+NiudvO3rC58vNURYGqgSYm2MiKj2W3NziHm7x.0MfQLf8CSj0UkYkGvjiSeC48xMDyJberYKlzo2Mi2L2.dUaktmwaz8s4Mq2oCjUIArKX136t+ubMMTdfFJekY3EQIqRsgLhvMpJP80Zd3DlXMW66ntneeVqKZvLWWjQ1Yds38nNnG9AccPeJdnL6m7GJuqktkhNMZ+AdHNFmUlSv4pyI3bs4Dbt9bBNqNmfymNmfyM9+BmPaZRFu6ADoOCpx0DZRVWlBfQNm5oZDwHipkA8XK0XEfZCsgGN3ufmHl1pwFQLsiY9exbD192YN59QTUn7fPJfeyCeiPKZpdUAwcgrnY0pKag5C0kblii5xpm.lxvIt0N2yFP7A8ftKgPfpSfzuvjT7zu4ongmomp3lO5qpryzzRMQDkeaZC+0SbUL0drt8hIy3WBs9nCTVHn0UWA2abTX6FbkJItRk0+WxUruEWox8lqjwL1MhL9DdwG+BqJLd2gRQec4b.gV0CaJ1vnNm.mlCSGf9a.jM0tCA
    


  • @ulrik aaahhh, brilliant, I get it now. Thanks so much 🙂


Log in to reply
 

15
Online

1.1k
Users

3.8k
Topics

33.3k
Posts