About Store Forum Documentation Contact



Post Reply 
List padding
Author Message
AndrewBGS Offline
Member

Post: #1
List padding
I am trying to display item icons in my backpack using some spacing between them. Instead of having my backpack look like:
XXXXX
XXXXX
XX

I want something like
X X X X X
X X X X X
X X

- you get the point.
I have no idea how to do that. I tried using the list.padding value, but all I achieved was to display a horizontal slide bar, absolutely no difference to the way my icons were displayed. columnWidth, columnHeigh dind't seem to help me either.

So can anyone please tell me how to have some blank space between the items in my list?
04-09-2013 06:44 PM
Find all posts by this user Quote this message in a reply
TBJokers Offline
Member

Post: #2
RE: List padding
You would first have to have a set value of the list width and height, then what you could do is add spacing manually when drawing the images.

Man, it's always that semicolon...
04-09-2013 07:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: List padding
Ok, that sounds like a good idea, but i'm not sure how I'm supposed to "add spacing manually".
The closest idea I had was adding blank thin icons, but that's not very smart, and doesn't help with space between rows in the list, just between columns.
So can you please detail your idea a bit? It would help me a lot.
04-09-2013 08:08 PM
Find all posts by this user Quote this message in a reply
Dwight Offline
Member

Post: #4
RE: List padding
Instead of just the icon, why not add a few pixels around the icon itself? Thus modifying the icon image. (e.g 2 pixels on each side)

[] -> [ [] ]
(This post was last modified: 04-10-2013 10:44 AM by Dwight.)
04-10-2013 10:44 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #5
RE: List padding
I see what you mean, I thought of that myself.
But if all my icons go in a region, it might look a bit weird that the grid between icons stops where the icons do.

Basically, I just wanted a grid of icons that i can slide through. This seems to be complicated to achieve with lists, maybe you can give me another idea on how i can do that?
Like, can I move/show different parts of a region using a slidebar? Hm, this just gave me some ideas I could try... yeah, i'm kinda new to all this. I'll see what i can dig up, thanks for the idea smile
04-10-2013 10:47 AM
Find all posts by this user Quote this message in a reply
Dwight Offline
Member

Post: #6
RE: List padding
Why are you actually using a list? Why not draw panels in your backback, and let the icon be placed at the location of the panel? In that way, you have full control of 1. How your panel looks like and 2. the exact location of each spot in your inventory.
(This post was last modified: 04-10-2013 12:13 PM by Dwight.)
04-10-2013 12:13 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #7
RE: List padding
That would be ideal.
The only issue there is I wouldn't know how to pick up items in the inventory.
that example function
if(Gui.ms()==&list) //or something like that, i don't have the code with me
was a very easy way to find out what item i selected. If i have say 30 panels instead, wouldn't I have to check every single one of them separately? Sure in a REPA loop, but wouldn't that be quite inefficient?
(I'm a sucker for efficiency).
Either way, really good idea, I'd have to find alternative solutions to sliding the inventory, but i can think of some.
04-10-2013 01:12 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #8
RE: List padding
(04-10-2013 10:47 AM)andreim44 Wrote:  I see what you mean, I thought of that myself.
But if all my icons go in a region, it might look a bit weird that the grid between icons stops where the icons do.

What about having blank placeholder icons?
04-10-2013 02:20 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #9
RE: List padding
I considered that previously, there are several issues about it:
The blank placeholders would stop where the item list would be over - to keep a neat grid aspect over all the inventory i'd have to make placeholders without items between them;
Another issue would be between rows. Or, having a whole row of placeholders to simulate a grid? Well, As I said before, I'm a sucker for efficiency, there has to be another way. I'm currently pondering the 30 slots option, with no list. (30 is a generic number of course).
04-10-2013 02:38 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #10
RE: List padding
As I mentioned in your PM, you would probably need to do custom drawing to do this using List.

However, I recommend using a Region with your own "grid" as you've already hinted at. You can place your items out in the Region however you like and it will automatically put scrollbars in for you. You can then have all the spacing you like.
04-10-2013 03:32 PM
Find all posts by this user Quote this message in a reply
Post Reply