I’ve came up with a basic module for my containers and I felt like sharing it here, I want to add on to this some more and hopefully optimize with some help.
This module is quite small right now and easy to recreate but if people can use this to learn and make something better, than i’m all for that.
Summary
This module just contains Events/Functions
that assist you with handling tons of ImageButtons
inside of GuiObjects
, every button must be an ImageButton and each ImageButton must utilize the .LayoutOrder
property, this will be considered the buttons ID.
I’ll be tracking updates/bugs here and you can find a small tutorial/reference in the github link below
SlimContainer Repository (github)
Roblox asset
Updates
```
3/11/2021
Fixed up the hierarchy a bit, allowing you to place ImageButtons in more flexible ways.
This will be helpful for people who want to handle ImageButtons that are
Grandchildren+ rather than a direct child of the Container.
```
```
3/10/2021
Implemented a property (container.Dragging) to enable/disable dragging based features.
This property will act as a flag to tell other code that the mouse is being
dragged over the Container.
This property (when set to TRUE) will also allow the .MouseButton1Up event to be fired
outside of the Container while dragging.
```
Bugs
--none yet
NOTES
-
Button.LayoutOrder is considered the ID.
-
All buttons must be ImageButton instances and they should use .LayoutOrder to represent their ID. (especially if you use a GridLayout and such)
*is not compatible with Mobile yet
enjoy, and if you have any feedback/suggestions please let me know as this is still a work in progress and i plan on adding more events, functionality and properties while keeping it as universal (and customizable) as possible.