Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Button Click region bug

Discussion in 'UGUI & TextMesh Pro' started by Seraphim-Whiteless, Aug 27, 2015.

  1. Seraphim-Whiteless

    Seraphim-Whiteless

    Joined:
    Jun 23, 2014
    Posts:
    197
    Hi! If button have not image and target graphic link to child image, then button click region decreases ещ child image size.
    But if i add empty inactive image to button, then region is expanding to button size
     

    Attached Files:

  2. NeilM0

    NeilM0

    Joined:
    Mar 31, 2009
    Posts:
    135
    Are you trying to create a clickable area in a large image?
     
  3. Seraphim-Whiteless

    Seraphim-Whiteless

    Joined:
    Jun 23, 2014
    Posts:
    197
    No. I need large button, but do not need "global" button image. Need icon only.
    Thats's why i switch off image on button and link target graphic to icon.
    But i need button actions on all button's area


     

    Attached Files:

  4. NeilM0

    NeilM0

    Joined:
    Mar 31, 2009
    Posts:
    135
    Ok, I think I've figured out the issue that you're having.

    That's how buttons work if you have a text label in them. As soon as you delete the text label, it makes only the icon clickable.

    A quick workaround is to add a second image as a child. Have it stretch to the buttons full width and height. Set the image to None. Set the alpha to 0. Now the entire button is clickable, with a small icon image and no text.