c# - Uneven grid with for loop(s) -
Then my problem is:
I have an RPG inventory that is a grid (7x4), loop For two through:
[update method] index = 0; For (int x = 0; x
* Itemlist is a list of only BaseIT class.
Similarly, I want to draw this code grid:
XXXXXXXXXXXXXXXXXXXXXXXXXXX
but instead it does this:
XXXXXXXXXXXXXXXXXXXXX
It is cut off from the line of the end which is no greater than or equal to 7.
Now when I use an item (using an item to remove it from the list), it adds the next hidden object to the end, the third row.
I appreciate any help thanks,
EDIT: Thanks for the help Nico, this code looks like now:
If (item number list.Count> 6) {for (int index = 0; index and lieutenant; item list; ++ index) {item list [index] .grid location = new point (index% 7 , (Int) (index / 7)); Catalog [index] Update Value (Screen Locking, Madsiz, Loci); }} And if (item list.lt; 7) {for (index index = 0; index and lieutenant; item list; ++ index) {item list [index] .grid location = new point (index , 0); Catalog [index] Update Value (Screen Locking, Madsiz, Loci); }}
I found that there was a problem where the item was below the list 7, none of this item will display it fixes over the code again thanks!
You can iterate using the index:
Item number = index; item index [index] grid location = new point (index% 7, (int (index / 7)) for the (ind index = 0; index and lieutenant; item list; ++ index);
Note that I flipped the item order. Your column-wise, now it's row-wise I think, you mean this because you have fixed grid width 7 and one variable line number. If this is not correct, leave a comment.
Comments
Post a Comment