Author Topic: GUI Work  (Read 1299 times)

Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark IV
  • *****
  • Posts: 3,932
GUI Work
« on: 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.



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).

Offline Teal_Blue

  • Hero Member Mark II
  • *****
  • Posts: 930
Re: GUI Work
« Reply #1 on: August 14, 2014, 09:32:48 PM »
Interesting, what game are you working on?

-T


Offline Draco18s

  • Resident Velociraptor
  • Core Member Mark IV
  • *****
  • Posts: 3,932
Re: GUI Work
« Reply #2 on: 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.