Animated transition from one GridView to another - animation

A transition animation between various Cells of a GridView is simply possible with RepositionThemeTransition.
But in my case, I need to move Elements from one GridView to another one.
is it possible to animate a transition while moving an Element (e.g. an Image) from one GridView to another?

Related

Sorting layers having no effect at all

I currently have a scene set up in Unity2D where sorting layers of any kind have no effect at all.
I start with 3 panels on the screen (attached to a canvas). The panels have some images as children. Then I position them such that there is some overlap between them. From there I attach a Sorting Group component to them, and then run my game.
From there I've tried everything I can think of to alter the sorting layers and have one of the back panels appear at the front but to no avail. I've tried altering the Sorting Group layers, the Unity layers, and the Z position.
What am I doing wrong?
I believe Sorting Group is a UI component. It's used for parent game objects of sprite children.
What you want is to add the "Canvas" Component (Not to be confused with the main UI canvas) to each of your panels. Then make sure Override sorting is checked. Then put a number in for the order. Larger numbers are in front of smaller numbers.

Render UI element in front of others programmatically without sibling index (2D)

I have a grid of buttons (3 by 3 for this example). When a button is clicked, it rotates 180 degrees. As it rotates towards 90 degrees, it increases in scale. Once it passes 90 degrees and rotates towards 180, it decreases back to it's original size.
Unfortunately, this is a 2D game so it seems that the layers are determined by the hierarchy, which is created in the order the buttons are spawned. This causes some ugly overlap issues when the tiles scale up, when I really just want whatever button is clicked to be brought to the front.
The common solution seems to be to set the sibling index, but that will not work in this case because the buttons are held in a canvas using a Grid Layout Group, and changing the sibling index causes the buttons to be reordered.
Add a canvas component to your button and use sortOrder to modify the rendering order of it.

Sizes of buttons with images

In my app I have two instances of the same kind of button (an own class I've made which subclasses Button and sets a specific UIID and also does some other things...)
One of them is added into a BoxLayout Y which is added as center in a BorderLayout. The other component in the BoxLayout is a label which is above the button.
The other one is added in a GridLayout which is added as south in another BorderLayout. The grid is 1 row and 3 columns (the button is one of the columns). The horizontal size is ample so there is no need to make it smaller to fit horizontally.
My issue is that these two buttons are of different sizes. The first one is significantly larger than the second. I suspect that the second one has been made smaller somewhere in the process but I can't understand why. I would like to have the first button be the same size as the other one, or the same vertical size (with the corresponding horizontal size) as the label above it.
I have tried to use the setHeight and setPreferredHeight of the button. The result was that the button was actually made smaller, but not the image on it so the image was cropped.
I have also tried to use the setSameHeight with the first button and the label above it, but the result was only that the label was made larger.
The problem you're having is the GridLayout Container.
What GridLayout does is that it divides the Container into 3 equal sizes and shrink anything in any of the column to fit within its space.
TableLayout on the hand is similar to GridLayout except that it's flexible. It adjusts itself to accommodate the size of the biggest component in it.
Change that GridLayout to TableLayout with the same number of rows and columns, and the Buttons would be fixed.
I will suggest you also add the second button to a BoxLayout container before placing it in the TableLayout.

Changing the dimension of jsPlumb canvas

I was wondering if and where I can change the dimension of the canvas in jsPlumb, the place where all my draggable elements are?
You can use simple jQuery to change the dimensions of any DOM element.
jsPlumb isn't really a canvas thing, it creates DOM objects to represent the graph.
$("#jsPlumbContainer").css('width','+=100');
$("#jsPlumbContainer").css('height','+=100');

Custom shaped NSButton

I am trying to create eight custom buttons (NSButton) in Xcode 4.6.3. Those are the segments of a circle. I used a standard rectangular button for each of them, adding a custom image for each segment. However, when I put the pieces together in one circle, there is no way to click some of these buttons, as the rectangular areas around each of them overlap, and prevent from reaching the other half of the buttons.
I was wondering if there is any way to make the button shape at least triangular, such that I can click on all of these buttons?
From the documentation "View Programming Guide":
Note: For performance reasons, Cocoa does not enforce clipping among sibling views or guarantee correct invalidation and drawing behavior when sibling views overlap. If you want a view to be drawn in front of another view, you should make the front view a subview (or descendant) of the rear view.
In other words, you can't expect overlapping views to process mouse events properly. There's no way of getting around the fact that views occupy rectangular frames. You have to make a single view which performs the work of all of your circle segments (including drawing and event handling, and optionally mouse moved events). YOu will have to use trigonometry to calculate which segment a mouse click occurs in, and respond appropriately as though a button were pressed, by re-drawing the segment and invoking the desired action.

Resources