Hi,
I'm in the process of customizing a Dialogue UI for a new project. I've used the generic one as a template, so I've been able to use the mouse wheel to scroll the Response Panel contents.
That functionality has stopped working when I've added a Unity UI Color Text script and an Event Trigger script components to the button template, to highlight each response when hovering them.
I still can scroll the responses if I use the scrollbar handler, but not the mouse wheel. Or to be more accurate, if I'm hovering a response then I can't use the mouse wheel to scroll them. I need to move the mouse pointer outside (but still inside the Response Panel) them so it works.
I'd very much like to tint the responses when hovering them, but also being able to scroll the responses with the mouse wheel, which is the most intuitive way to do it, ofc.
What could I do in this case?
I have Unity 2017.1.2p4 and Dialogue System 1.7.6.
Some screenshots...:
Mouse wheel scroll doesn't work with Unity UI Color Text
Re: Mouse wheel scroll doesn't work with Unity UI Color Text
Hi,
The Event Trigger script consumes events so the regular Unity UI handlers (e.g., scrolling) never receive them.
Instead of using Event Trigger, add a script like the one below. It provides UnityEvents for OnPointerEnter and OnPointerExit without consuming the events.
OnPointerEnterExit.cs
The Event Trigger script consumes events so the regular Unity UI handlers (e.g., scrolling) never receive them.
Instead of using Event Trigger, add a script like the one below. It provides UnityEvents for OnPointerEnter and OnPointerExit without consuming the events.
OnPointerEnterExit.cs
Code: Select all
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;
public class OnPointerEnterExit : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
public UnityEvent onPointerEnter = new UnityEvent();
public UnityEvent onPointerExit = new UnityEvent();
public void OnPointerEnter(PointerEventData eventData)
{
onPointerEnter.Invoke();
}
public void OnPointerExit(PointerEventData eventData)
{
onPointerExit.Invoke();
}
}
Re: Mouse wheel scroll doesn't work with Unity UI Color Text
Oooh, so it's actually a Unity issue! And here I was asking your help as if it was a problem on your plugin's side...
But you helped me all the same... What can I say? You rock, as always.
Thanks!
But you helped me all the same... What can I say? You rock, as always.
Thanks!
Unity 2019.4.9f1
Dialogue System 2.2.15
Dialogue System 2.2.15