Why are button transition animations not resetting to normal position? - unity3d

When I mouseover button it works fine. But when I clicked and enter inside the credits scene and came back the default width of the credits button changed and not reset to normal position.
It should return to normal position whenever if I clicked the button and enters into any scene and return to the current scene.

After having long conversation, this is the summary and solution.
Naveen was using Unity's default animation transitions for buttons.
As, he only needed highlighted transition, he only added that animation which scales the button. But, no animation was added for the normal state. As a result, when he was switching the canvas, the scale of the button was already increased and stayed there.
There can be multiple solutions, but here's mine.
Just add keyframes in normal state, which keeps the button in normal scale.

Related

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

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?

How to remove the highlight state of button in unity?

I have created button animations but i want it to show just the normal, pressed and disabled animation clips. Do You Have any idea how we can achieve this.
When The Cursor Goes over it should keep playing the "normal animation clip".
Make sure that your Button Settings look similar to this example and that you have created all the needed animations for your button with the correct names.
In this example the Button plays the Normal animation when the player highlights as well. You could also add the Normal animation to the Selected Trigger or just let it empty (or don't create the animation with that specific name)
If you just wan't to keep playing the Normal Animation let Highlighted and Selected empty

How to show smooth transition in pageview if jumpTo function id used?

I am trying to change the current page upon click event using jumpToPage().
But, it's changing it very abruptly without any animation.
The point of transition is that the user does not have to click next and plus if clicked on the wrong checkbox then he would know that if I scroll up I can change the option again.
Use animateToPage:
Animates the controlled PageView from the current page to the given page.
The animation lasts for the given duration and follows the given curve. The returned Future resolves when the animation completes.
You have to provide a duration and a curve
https://api.flutter.dev/flutter/widgets/PageController/animateToPage.html
See all the curves animations here:
https://api.flutter.dev/flutter/animation/Curves-class.html

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.