ID:159860
 
Alright, I'm starting to mess with interfaces again.
I figured my first project would be to create a little boxxy grid inventory.

So I have the grid. 8 rows, 8 columns.
What I had in mind was, a background for each cell (kinda like this), and then the object icon sits right over it.

Well, I've run into a few problems.

One) Setting an icon into a grid entry works (gotta use \icon), but the icon is SMALL (no, small icons is not checked. normal objects appear fine). I'm going to assume it's 16x16. I've tried to remedy this via styles, but that didn't work. The img element modifier does absolutely nothing. I thought maybe I could modify the size of the cells via the body element and maybe it would kind of force it, but nope. It's really kind of annoying, cause object entries are 32x32 (34x34 with the padding?) while the "filler" icons are all 16x16 (I think), which obviously doesn't work.

Two) I'm kind of fuzzy on how this would work. Since I can't assign the elements background images, my only option is to assign the object an underlay or something. But I can't do that. I thought I could create a separate image and add the underlay to that, but that wouldn't work either. Basically, I'm left with creating a separate icon with the background included, but even if I did this... do grids register clicks on just the grid cell itself, or does that only work if it contains an object? (doesn't look like it)

So basically the idea is... 8x8 grid, each cell should have a background of some kind, and then the contents of the mob are added.

I don't care how I end up with this result or the method that's used (well, I kinda do), as long as it works.

So anyway, if anyone has any ideas, I'd appreciate it.
I haven't done any work with grids before, other than shoving text in it.
One) Icons can be output with the img tag. You can make the grid accept http images and then modify the style to be whatever size you choose.
viewer << output("<img class='myClass' src='\ref['myFile.dmi']' iconstate='myState'>","myGrid:1,1")


I don't know much about the second question, but that particular background image can be mimicked with dark grid lines and a gray background. It won't be as 3D, but it seems like you're doing a lot of fighting for those small borders. You could also compromise by outputting the background image to the empty cells, making them look raised while the filled cells without borders look depressed from the weight of the contents.