SlimContainer - A module used for inventories, shops and other container GUI

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)

Repository


Roblox asset

SlimContainer


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

Media

Basic but functional inventory made with SlimContainer
Basic Inventory system with dragging


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.

10 Likes

your module looks nice. just don’t worry about having to use metatables or not. same applies to whether or not u have to use OOP. use it when needed which you did.

1 Like

thank you and yeah makes sense, i’ll use them if needed later then.

1 Like

Thanks, this can help a lot young developers who are trying to create stuff but don’t know how to themselves. Also others can learn from it. :slight_smile:

2 Likes

no problem, and hopefully so :stuck_out_tongue: