Unity: How can I make a button clickable under an draggable area? - unity3d

I am working on a screen of a game, and I want this behaviour: when you swipe in any place of the screen (even over a button) you can scroll, but at the same time you can click in any button.
Now I have a big empty image occupying the whole screen that can capture the drag events, but since raycast is ON, click events are not passing down to the elements below in the hierarchy. So buttons are not working.
Which is the proper way of achieving this?

Related

Flutter: Partially overlapping buttons that can switch overlapping on tap

I am trying to create a layout of two elevated buttons as below screen shots. One button is partially overlapping other button on the right side. When button on the right is tapped then it will partially overlap the button on left.
I can do it using stack but that will require a lot playing around with the positions.
I am wondering if someone could point me to the right direction on how to achieve this layout.
Regards,
Jamal

Dealing with Popup in Corona game engine

I have a screen in Corona to display a puzzle, and once user guess the correct answer, I'm going to display a simple pop up on the screen to do the congratulation a long with close button to dismiss the popup, now I need for a simple work around to disable any control or behaviour on the original screen while displaying the popup, how can I do that?
I think you need to do this by stop or pause transitions, timers and animations etc. before you go to scene with pop up.
You can add transparent rectangle from transparent image file (not just rectangle, as it will not be touchable).
Size of this rectangle must be the size of all screen.
Position of rectangle - under your popup (or better make it as part of your popup).
Add listeners to this rectangle on touch and tap that will just return false - so it will prevent any clicks under it.
That will save you from pausing / disabling buttons, that you don't want to disable/pause.

Unity button doesn't behave as it was clicked after a click and drag

There is a simple button in our application which when is pressed works just as expected, but with a light quick touch it just greys out and does nothing.
Is there a way to capture those light touches too?
EDIT:
I see now when exactly it doesn't work and it is when I tap, drag and release. (even if I tap, drag and don't leave the button area)
Try setting EventSystem.pixelDragThreshold to a higher value. This threshold makes the difference between a click and a drag, and it's default value is quite low for high-res touch systems.

Touch feedback during swipe left and right

My app has a master-detail structure, where the user can tap on a master item to go to the detail view and then swipe left or right to navigate to other details items.
I'm using on-swipe-left and on-swipe-right to let users swipe between the detail views, however, when the user swipes, there is no visual feedback that there is a swipe happening. Only after the user has fully swiped does anything happen. I thought I could use the slide box, because the slidebox does provide visual feedback as soon as you start swiping, however, my views have vertical scroll and that conflicts with the left and right swipe actions due to the swipe sensitivity. In other words, when the user touches the screen to begin scrolling down, the swipe action takes over and it tries to swipe left or right instead of scrolling down.
So, what are my options? Is there any way I can provide some kind of an animation with on-swipe-left and on-swipe-right so that there is some kind of visual feedback (may be an ink trail on the screen) I can show the user? Or is there any way I can make the slidebox approach work so that the horizontal swipe and vertical scroll can function harmoniously? I have seen other apps that have scroll and swipe functions working harmoniously--gmail and pinterest are examples. Just not able to get it working with ionic.
Or is there another UI pattern that I am not thinking of? Worst case, I could provide buttons for next and previous, but this is a mobile app, so I really shouldn't have to resort to that.
Thanks!

Unity3d UI Buttons MultiTouch

I am building a game in which there are two ui buttons on the game. I am using unity 4.6 to build this.I have one button that will turn my player blue and another that will turn the player yellow. I need it so when both are pressed my player will turn green. I haven't found much on multitouch with these UI buttons. I would love the help!
In the usual button paradigm, the button completes the action when the user presses the button and then ends the press while the pointer (mouse or finger) still on the button. This is called "click". You are saying that you need this event to happen while the buttons are still pressed — so, you want them to react to press-down event, not the click event. Therefore, they are no longer classical buttons, and you probably shouldn't use Unity's UI Button for this functionality. If you'd use buttons for that, when the user first pressed on both buttons, you'd get green color, but when he then stopped touching them, you'd finally get yellow or blue player.
Instead, use the EventTrigger component on each individual "pseudo-button" to register press-down events, and a separate custom component that would implement your logic. Essentially, the only way to realize your requirements without them being contradictory, is to assign the yellow color when the player is pressing down both "pseudo-buttons" and assign other colors when the player lifts his fingers up from either of them — but given that this particular touch wasn't used to trigger the yellow color.