Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Toolbar Button Active State background

Discussion in 'UI Toolkit' started by XGT08, Aug 30, 2019.

  1. XGT08

    XGT08

    Joined:
    Aug 1, 2013
    Posts:
    1,893
    Hello,

    I am currently building a UI using UIElements and I have a bit of trouble making toolbar buttons work as expected. With IMGUI, my buttons would change their look when pressed even when using a custom background texture. With UIElements, I set the toolbar button style's backgroundImage property to use the desired background image, but when I press the button, the image is no longer affected by the click.

    How can I tell the toolbar button to react properly when it is pressed? Ideally, this would have to be possible without having to design a different texture for the active state. Also, is this possible to do with C# scripting only?

    Thanks,
    Andrew