How to implement backpack UI in Unity - unity3d

I want to make a backpack UI that can dynamically add and delete items like a menu, but every item in it is a picture (not a text)
I found many tutorials but all of them are panels with slots that need I to set their positions previously. I wonder if there is a better way to make it more easily.

I think the best way is to use a Vertical Layout Group:
https://docs.unity3d.com/Packages/com.unity.ugui#1.0/manual/script-VerticalLayoutGroup.html
Obviously for adding and deleting in player, you have to create buttons with relative scripts.

Related

How to create a virtualized, reorderable list with dynamic sizes, and animated item adding and removal in Flutter?

I need a flutter list package with the following features:
Only renders items in/near visible range (virtualized)
Supports different item heights.
Reorderable through drag and drop
When an item is dragged to the edge of the screen, the list scrolls
When items enter or exit, the list animates nicely
The package ReorderableListView.builder (https://api.flutter.dev/flutter/material/ReorderableListView/ReorderableListView.builder.html) supports 1,3 and 4. No support for 5. Reordering animation was bad for items with differing heights (2) when I tried it out.
The package implicitly_animated_reorderable_list
(https://pub.dev/packages/implicitly_animated_reorderable_list/changelog) supports 3 and 5. Nothing mentioned about 1 or 2 in its readme, and a comment from January here (Flutter: Reorderable AND Animated ListView - any idea?) suggests 4 is missing.
Looking for advice on how to achieve this:
An amazing package that can do all 5.
A way to add features of these different packages together somehow. Is that at all possible?
Advice on forking or not forking and just starting from scratch.
In regards to forking what in your opinion is the most/least trivial of these features to build from scratch?
I'm new to Flutter, so anything I don't know enough to ask about in relation to this subject is also greatly appreciated.
Own answer:
There really isn't a need for any plugins or forks. ReorderableListview.builder can be used to accomplish all 5.
Not sure how I botched the code that made me think ReorderableListView.builder wasn't handling different heights of items correctly, but whatever the glitch was (maybe related to keys?), I'm not able to reproduce it. Interesting that all the docs/tutorials I found only show statically sized list items when dynamically sized list items are no problem.
As for the animated exits and entrances (i.e. not letting the list items seem to jump up and down in a disorienting way), this is really trivial to do by animating height with AnimatedContainer. The existence of a separate AnimatedList widget and ImplicitlyAnimatedList plugin threw me off a bit.

Can you turn subsets of slides into a custom component in Ionic 3+?

I have tried to create custom components which are subsets of slides. I'm trying to create a custom Ionic component which is a subset of slides. Then I can mix and match subsets of slides in one to make a complete slide show. Like building a master process from sub-processes. You should be able to swipe back and forth between all slides as expected, no matter an directly in the component, or slides within custom components.
I've tried various methods to no avail. Any ideas?
PLEASE SEE THIS SAMPLE PROJECT WITH 2 METHODS I HAVE TRIED TO ACCOMPLISH THIS.
No. You can't do this. You can put a into another if one scrolls vertically and one horizontally. You can insert a custom component into an which just has a couple slides in it, put the inserted slides show one over the other vertically with no way to swipe back and forth. So, no. You can't do this. Perhaps with dynamic templates you can build the from code dynamically. That's the only work around I can see.

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

How to implement a image list control with SWT?

Does anybody have any idea on how to easily implement a image list(like the windows explorer with medium icons) control with swt? it seems like that it could be done easily with CListCtrl in c++ on windows, but does not seem to be easy with swt? any hints are appreciated!
Up to me, you need to create your own widget (check e.g. http://www.snip2code.com/Snippet/11489/Custom-SWT-List-Box) and add composite items to your custom list.
If vertical-only scrolling is enough, I suggest you rely on a single column TableViewer. This is what I did in a project where I needed a gallery-like window allowing the user to pick a graphical component based on displayed thumbnails.
You just need to implement the proper TableLabelProvider.getColumnImage and return the desired thumbnail corresponding to your list entry.
That gives a pretty decent list-like rendering.
In addition, TableViewer API is very well documented.

Arrange GUI elements in WPF in a similar way to the applications on the iPhone

I would like to arrange UIControls in WPF in a similar way to the applications on the iPhone. They should be positioned on a grid, but a user should be able to drag them somewhere else, after releasing the mouse button (or the finger in case of an iPhone) the selected UIControl should snap back to the next position in the grid. The other UIElements should be rearranged automatically.
Further the user should also be connect two elements with a line or something.
I'm not experienced with WPF. The first question is if there is a container which is suitable for something (System.Windows.Controls.Grid ?) or if I have to extend canvas or somethig else for this.
I would like to know which elements from the WPF framework can be used and which elements I have to write myself.
For people who do not own an iPhone: http://www.youtube.com/watch?v=3omhu2AUWC8
Update
I've looked at AnimatedTilePanel in the BangOTricks examples (see below), this one explains how to create your own Panel and how to let it arrange things there.. However I still need an idea how to implement drag and drop correctly in this example..
Unfortunately, you'll have to write a lot of things yourself, as WPF doesn't automatically do what you're looking for.
For positioning the controls, you can use either UniformGrid or Grid. Assuming it's much like the iPhone video you showed, you can just use the UniformGrid with 4 columns and however many rows you need.
For the dragging animation, layout-wise, you could start by manipulating the RenderTransform property on whatever is being dragged, but you'll have to set a handler to check once you've met whatever threshold necessary to move into the another "cell" -- and at that point, you'll have to changed the order of the items in the tree.
Take a look at AnimatedTilePanel from Kevin's Bag-o-Tricks at:
http://j832.com/bagotricks/
It doesn't do everything you want but it will show you how to write a panel that animates its children when changing size or order.
New input to this old post in 09. Earlier this year (2012) someone has wrote a FluidWrapPanel and open sourced it. I tried it and it works like a charm - just like that on the iPhone menu.
You can also apply to other UI Elements or UserControl.