Arcen Games

Other => Game Development => : Draco18s August 13, 2014, 03:50:54 PM

: GUI Work
: Draco18s August 13, 2014, 03:50:54 PM
I hate GUIs, so much.  And not even in the "what does the GUI art look like" but making GUIs functional.

In not seeing a good drag-and-drop slot-based inventory system on the asset store (at least, not for anything less than $50) I poked around and found the critical code that lets OnGUI objects be draggable.  Which was simple enough to work for any game object.

So I've been building/writing my own GUI inventory system, hoo boy.

But two days or so worth of work and it's remarkably generic and extendable and quite functional.  It scrolls, its got tabs, it can handle slots and collections.

(http://s21.postimg.org/9z4yjkqp3/wipgui.png)

Obviously still some work to be done, like the fact that the container's border is behind the icons, as well as the icons themselves (the item icons are a spritesheet: A, B, C, and 78 blanks :p).  But damn, for how much work this was, it works great.  Each container can be of any (limited) size, has an overridable function to filter the contents--the default is "do I have space?"--and can handle basic swapping (if the destination can only contain 1 item and it is occupied, it'll send the item to the origin container of the new item).
: Re: GUI Work
: Teal_Blue August 14, 2014, 09:32:48 PM
Interesting, what game are you working on?

-T

: Re: GUI Work
: Draco18s August 15, 2014, 09:02:11 AM
Interesting, what game are you working on?

Tower Defense game.
http://www.pages.drexel.edu/~mmj29/temp/pgtd/pgtd.html

May or may not actually be using the above interface, but I figured I might want it someday and it was pretty easy to build.