How can I combine menu animation and button animations in unity3d? - unity3d

I have a canvas with an animator that animates the transition between different menu items. I also have buttons (nested in canvas) whose position and size are animated by canvas. And each button has its own animator with the animation "pressed" (resizing and rotation). The problem is that the button click animation has the wrong look. The button does not change its size and rotates a smaller degree. I think the point is in the "weight" of the animation, since canvas animates the same button. But I have no idea how to fix it ...
1st screenshot
2nd screenshot

Related

Fade transition on click

In jssor I can create an auto/timed transition to fade the next image. Is there a way to adapt this to do the same fade when the left/right arrow are clicked? I couldn't find any reference to this in the docs.
Cheers

Why does unity shows UI button shows on top of background in game view whereas they are far from each other in scene view?

In the below image, you can see that the scene view and game view are different. The scene view just has the UI button but the game view shows the background image. In the scene view, the background image is so tiny, and is in the lower left corner. The button and the background is far in the scene. Also, in the main camera, I see the background but no button. How and why does game view shows the button on top of the background? What is the logic behind this?
how and why does game view shows the button on top of the background?
This is the normal expected behavior.
You are using a Screenspace Overlay Canvas which is in pixel space coordinates while the rest of your app is in Unity units (usually 1 per meter).
=> So for example if your GameView is 600x800 pixels in order to place a button with dimensions 100x60 at the bottom right it will have a position coordinate somewhat like 550x30 which is of course way out of the dimensions of the rest of your app content -> The canvas just appears huge and UI elements far apart in the Scene View.
To see your "normal" content simply double click on an item in your Hierarchy View and it will zoom in on it.

Slide view while touching button - IOS

I'm trying to implement a view that includes social buttons.In normal state, it will be partially hide and only the "Opciones" button and the upper line is shown. This view will be shown when user touches button "Opciones" (touch gesture), then it will unhide and be shown using sliding effect until the final position that is included in the attached image.
I'm wondering which kind of control and animation I have to use.
Many thanks.

iPhone - scrolling a UISCrollview to keep objects moving

I have a UISCrollview. Inside this scroller I have a picture and over the picture I have some objects (as subviews of the picture), like layers in a Photoshop composition. So, if I zoom the picture, the objects will zoom. If I scroll the picture, the objects scroll.
Now consider this: I have the picture zoomed in. The picture is now larger than the iPad screen. I am seeing the top half of the picture. I touch an object that is over the picture and start dragging it to the bottom of the screen. My intent is to drop the dragged object at the bottom of the picture, but as the picture is zoomed in, I have to drag the element to bottom of the screen, release it, scroll the picture up and then continue dragging the object.
What I want is this: I start dragging and when I arrive at the boundary of the screen, the scroller starts scrolling automatically showing parts of the image that were down or up.
What do I need is to know the rect that is visible, a kind of inverse of scrollRectToVisible...
Considering that the picture can be zoomed at any level, how do I know if the element I am dragging is near the border. BTW, how do I know what part of the scroller is being shown, even if it is zoomed?
thanks.
The visible rectangle has a size of scrollView.bounds.size and an origin of scrollView.contentOffset, in the coordinate space of the scrollview. Depending on what exactly you are doing, you may need to use convertRect:fromView: or convertRect:toView: to convert it into the coordinate space of the zoomed view.

How can I pause a currently running animation?

I have a Core Animation running and want to pause it when a button is pressed. So there is a method -pauseAnimation. When the animation is paused, I want the animated view to stay in the state as it currently was while animating. i.e. if a view moves from top left to bottom right, and somewhere in the middle the animation is paused, the view should stay in the middle.
Is there a way to do this?
as far as i can remember there is an setAnimationsEnabled=NO option, but that doesn't work when the animation runs, right?
You can pause layer animations by setting the speed of the animation to zero, see How to pause the animation of a layer tree.
You can do this by disabling animations and then setting the model layers' values to the presentation layers' values (for all properties that define your animation).
eg. layer.transform = layer.presentationLayer.transform;
Resuming the animation = re-enable animations and animate from current positions to the desired final positions (you might have to adjust curves, etc to get something acceptable).