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. Dismiss Notice

Detecting touch on Text ?

Discussion in 'UGUI & TextMesh Pro' started by CalaveraX, Oct 31, 2014.

  1. CalaveraX

    CalaveraX

    Joined:
    Jul 11, 2013
    Posts:
    143
    Hi everyone!

    I'm trying to make a SplashScreen, and i managed to make my splash image, to be a button, so i touch it anywhere and go to main menu.

    Except for a Text "Touch the screen to continue" that blocks the raycast and if i touch in the text nothing happens.

    Any help on linking the text also go to the main screen?

    Thanks in advance!
     
  2. CalaveraX

    CalaveraX

    Joined:
    Jul 11, 2013
    Posts:
    143
    I don't know if this is a perfect solution, but it worked fine for now

    i've implemented interface IPointerClickHandler
    and used the method OnPointerClick
    Code (CSharp):
    1.     public void OnPointerClick(PointerEventData eventData)
    2.     {
    3.         manager.GoToMainMenu(gotoMenu);
    4.     }
     
  3. ChimeraSW

    ChimeraSW

    Joined:
    Jul 24, 2013
    Posts:
    28
    You can add a canvas group and uncheck the block raycasts button.
     
    CalaveraX likes this.