cancel
Showing results for 
Search instead for 
Did you mean: 

Pressed button image

heyo
Senior

Hello,

Is it possible to use bigger pressed button image than released button image? How can I achieve it?0693W00000UnwIaQAJ.png

15 REPLIES 15

Yes that's normal, so you'll need to play with these functions now :

    if (button1.getPressedState() == true)           // to know if we pressed the button
    {
        container1.setWidth(container1NewWidth);             // change the container width
        container1.setHeight(container1NewHeight);             // change the container height
        button1.setX(button1NewXPosition);             // change the button X position to display the area you want to show
        button1.setY(button1NewYPosition);               // change the button Y position to display the area you want to show
        
        container1.invalidate();
        button1.invalidate();
 
    }

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX

OK! Ill try it. Thank you again.

heyo
Senior

Hello @Osman SOYKURT​ . I created virtual function which calls when button is pressed and then changes containers height but nothing happens and I am sure that it fulfils function : container1.setHeight(container1NewHeight); Do you have any suggestions? Thank you.

I do like this and changes only button position : 0693W00000Uo7YtQAJ.png

.

Hello heyo,

Do you use invalidate() function afterwards?

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX