Need help with panel



  • Does anyone know if I missed something up here? It's not drawing the image at all.

    The filmstrip works perfectly if I use a button. Tried to use Content.addPanel and adding it as a child panel to another one but it still isn't appearing.

    //Atlas
    
    const var ComboBox_AtlasUpArrow = Content.addPanel("ComboBox_AtlasUpArrow", 50, 50);
    
    ComboBox_AtlasUpArrow.setPosition(60, 200, 50, 50);
    ComboBox_AtlasUpArrow.loadImage("{PROJECT_FOLDER}ComboBoxArrow_Up.png", "AtlasUpArrow"); 
    ComboBox_AtlasUpArrow.data.imagefile = "AtlasUpArrow";
    ComboBox_AtlasUpArrow.set("allowCallbacks", "Clicks & Hover");
    
    ComboBox_AtlasUpArrow.setPaintRoutine(function(g)
    {
    	g.drawImage(this.data.imagefile, [60, 200, 50, 50], 0, 0);
    });
    
    ComboBox_AtlasUpArrow.setMouseCallback(function(event)
    {
    	if (event.clicked)
        {
            Console.print("test");
            this.setPaintRoutine(function(g)
            {
                g.drawImage(this.data.imagefile, [60, 200, 50, 50], 0, 24);
            });
        }
    
    	else if (event.mouseUp)
            this.setPaintRoutine(function(g)
            {
                g.drawImage(this.data.imagefile, [60, 200, 50, 50], 0, 0);
            });
    
    	else if (event.hover)
            this.setPaintRoutine(function(g)
            {
                g.drawImage(this.data.imagefile, [60, 200, 50, 50], 0, 12);
            });
    
    	else
            this.setPaintRoutine(function(g)
            {
                g.drawImage(this.data.imagefile, [60, 200, 50, 50], 0, 0);
            });
    });
    

    3eca4386-9205-41ec-a477-ffd4097e51c3-image.png



  • This post is deleted!


  • Do you need to set a colour before you can paint an image, in order to set the alpha?



  • @d-healey I've tried that with fillAll, it draws the panel and fills it but still doesn't open the image. Also tried with different images and still not working, panel works normally in every other aspect



  • the weird part is that I just copied my code from other working panels and it just didn't work

    i was thinking z position was the reason but:

    d287575c-6364-4c1b-80f3-4ba42f9a998c-image.png

    it's right on top



  • @iamlamprey said in Need help with panel:

    @d-healey I've tried that with fillAll, it draws the panel and fills it but still doesn't open the image. Also tried with different images and still not working, panel works normally in every other aspect

    I mean g.setColour(0xff000000); for example.



  • @d-healey Nope, drawing a black square. Also just tried

    panel.set("opaque", 1);

    and

    panel.set("visible", 1);

    and neither changed anything

    edit: and g.setOpacity also didnt work



  • This works for me, replace image path with the one you're using:

    HiseSnippet 846.3ocsU0laSCDDc2z3pFCAARb.rxubjJQN.EPpBQo4CHTZqUSoEI.UsXuIdas20xdSKgpJw0gaAWBtGbCfY85Tm.gpRjvppJyGO62Nyal0MQ3QSSEIHbk8GGSQ3aZzeLWFzJfv3ndsQ3aYrMIURSrzt1bbLIMk5iv3kdgxAtRYT1yOd1ljPB2iV3BgNPv7nulEwjEdc2XKVXXWhOceVzTY+vM54I3sDghQ.eVxvAES7NgLjtCQkVICDd4N9LoHoujHooPNaJ7G2OPbFWm+ArT1GCoJiln9vKR6F0JfE56N4rlhP3xtEm7kzm76ZrMymco+hJvsyBXUfX5Z.tzrTp7LTp4eiRcEg9pWvegd3onWYM8tiQeuDVrrHhha2vnGGZNCHPYeZZoyEU5aXiVBHCtrQD4DZ2Dv3RD1OxwYUq0bbpudUyplPwOUZcJIwxkvogMsdp0DrCoxVhnXAGLrqoCWSgR+yFgBheuHnUYW6b2818UcZs+Qc280s6r2Ea0+XmC+7IMNNdXsUspwTYUS+AyAmRktPsVtmXjjwo1CFw8jLA2dX8plmW0zBdTrh.D5c.gg+jArTEoNj4KCrqW33kT1v.oc8OrtFm9+Ca3mPNKmfZFrpEI6MAmcyKpu9juokfuiPR2kaW27byJlWXZ86gFLXtwTkpDQXHMYtgUR8jqBnMeTzGoIqBG0vQzKSD5+yJvV95Iv7zctoRTv6wYxcio41ERvlyQBhxa8vudSu1DIQoJy8A4ESSjLEcvsomBi3ZMZEi1zzSjh3rby0K.kkYQqNQAqZ6HF7oWwPKAPepXKvQaL9Riu79MNS0gQXC72A6frtqx5qYKR9igDXTU3OJjHmc9UsnJO.TymYPQMLvSYxwSuH6eXn1YtC0yshdMo6cLbYRuf4y2RyguPm4+MeyWQV0nyfATOYAYKaz8sK59v+ApnWMLbahLgAZEicFE0GtkviBLgCJnTklnjR0pscT1pJSeJ2Oy3mvSdvlJabdvlSBhhHdIhi7zSipkvqj4A3DO69mJvEgfsUST1DJfyvogCJBta3HOOUo3d.2mOl6u.XdvBf4gK.l0V.LOZAv73E.yStRLpqke9HoHROl.Nb6jspBi6vIfJKSQh9E.BKKlu
    

    Could your area value be wrong?



  • @d-healey Yeh your code works for me too, maybe the area is wrong or some other part of my code is overriding something or hiding it... time to dig


Log in to reply
 

10
Online

1.3k
Users

4.3k
Topics

38.6k
Posts