- Newest
- Most votes
- Most comments
Hi @REDACTEDUSER
Thanks for your question.
I'm not sure I understand exactly what it is that you are trying to do, but it sounds like you should either use LyShine to handle the inputs or the InputChannelEventListener but not a mixture of the two.
LyShine will consume mouse down events if you press the mouse while hovering over a button. Are you not seeing that happening?
Are you using C++, Lua or ScriptCanvas to write your interaction handling code?
The simplest thing, if you just want to get button clicks or press/release for buttons is to let LyShine handle it since that will do the work of knowing which button your are clicking on. You can either use action strings or notification buses such as UiButtonNotificationBus.
If, for some reason, you do not want LyShine to handle input you can disable that for a given UI canvas, either in the UI Editor canvas properties or via code/script.
Buttons are designed such that if you press down on a button but then move off the button and release then the click event is not sent. It looks like, in this case, it also doesn't send the released notification. Is this what is causing problems for you?
Rob
Thanks for the reply. Unfortunately my canvas contains simple buttons and more complex elements (images which i manipulate myself) and using only LyShine is not sufficient.
Yes, mouse down events happen on lyshine but are not consumed, while mouse up events are consumed.
I am using c++.
Would you suggest using a few canvases at a time then to avoid clashes between LyShine and
InputChannelEventListener or would that cause more problems?
Edit: it seems that after i disabled and enabled "Handle positional" option on my canvas, mouse down events started getting consumed as well.
Using multiple canvases is supported and can be a good solution in certain situations. I'm not sure if it makes sense in this case.
When you say it started working after disable/re-enable do you mean you did that in the UI editor and resaved the UI canvas?
This post is closed: Adding new answers, comments, and votes is disabled.
Relevant content
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago