I got yet another problem.
I have an inventory window with items 30x30 which are divided by a 1 pixel gap. Since there is no possibility to acount for that gap, I increased the size of the items to 31x31 by adding transparent pixels. Still the items are treated as being only 30x30, thus they overlap by 1 pixel.
I tried to make the color solid instead of transparent, therefore really increasing the size, but it made no difference.
Just to be clear, you did set both ItemWidth and ItemHeight to 31 in the properties of the InventoryWindow?
AGS doesn't care about the sprite size, the positions of the items are determined by those two values.
Yes, I set both the ItemHeight and the ItemWidth property in the editor of the inventory window to 31.
The first item is correctly displayed, but the then every other item overlaps by 1 pixel.
I even tried to set it manually within the script. But it didn't help. I even got weirder effects.
Are you sure you've made the entire inventory window wide enough to accommodate the amount of sprites when they're each one pixel wider?
The inventory window is big enough.
And wouldn't a small window just result in fewer items per row?
Make the Inv Window ItemHeight and ItemWidth about 3 pxs larger the your items are.
You may need to adjust window size to line inv items up better in a row. If you want say rows of 5 then make sure that is what you get by adjusting the window size.
Example:
My inv items are all 29x29 and the ItemHeight and the ItemWidth are both 32. Works fine and has a small gap between. My inv window is 355 x 68 with 11 inv items per row.
If this does not work then you may have other issues.
If I set width and height to 33 I get a two pixel gap. Now when I set it to 32 I still get a two pixel gap. So 32 and 33 is the same, as is 30 and 31.
I generally do not use any transparency when I import my inventory window images. This way they fill the inventory slots with just a very small gap between items.
Example:
(http://i1181.photobucket.com/albums/x423/qikfire/inventory.png)
I tried your suggestion without transparency, just with solid 30x30 items. But I get this two pixel gap.
In your example it also looks like a two pixel gap.
I got the impressiont that it is not possible to have odd-numbered tiles in the inventory widow.
You can have odd, even, makes no difference. Above image shows 11 per row (odd).
if the items are now 30x30 set itemheight and itemwidth to 32 /33 and adjust window size to show as many items as you would like or can fit in per row.
apart from that you may have to do trial and error.
I did not mean the number of items. I meant the size of the item + gap. In my example this is 30+1. Thus it would be logical to set the width and height to 31. But I get the same result as setting it to 30 (no gap). If I set it to 32 or 33 I get a two pixel gap.
And I have tried a lot of different combinations.
I can't confirm this; using 30x30 sprites and 31x31 dimensions produces a perfect 1 pixel gap for me, horizontally and vertically (in a 320 game though).
Are you making a highres game? Because it used to be the case that certain settings could only use lowres coordinates, and what you're describing sounds exactly like the old version's quirk that one for instance couldn't place objects on odd coordinates.
Check General settings -> Backwards Compatibility -> Use low-resolution co-ordinates in script, set it to false.
(I actually tested this before posting this with a 640 game and that option is indeed responsible.)
Yes, that was the solution cause I'm using 640x400. I would have never found that option on my own.
Thank you very much, Khris! You're the best.