Hi WME Folks,
I'm interested in creating a customized inventory so that I have more control over the interface. (Basically, I'd like to make sure that all items, regardless of size, are centered within the cell.)
1. Within the builtin inventory structure, is it possible to center a sprite within a cell?
2. How would one go about creating a custom inventory? My thought was to create a window and then position the inventory items within the window. Can I do this with Item objects, or would I need to use Buttons or another form of UI object? My first attempt was this which, as this post might suggest, failed miserably:
var current_point; // coordinates of upper-left corner of current tile
current_point.x = start_point.x;
current_point.y = start_point.y;
for (var i=0; i < Game.NumItems; i=i+1) {
var Item = Game.QueryItem(i);
// display and position the inventory item within the window
Item.X = current_point.x;
Item.Y = current_point.y;
Item.Active = true;
// update current_point
current_point.x = current_point.x + tile_size.x + tile_spacing.x;
// have we reached the end of the row?
if (current_point.x >= (start_point.x + ((tile_size.x + tile_spacing.x) * num_tiles.x))) {
current_point.x = start_point.x;
current_point.y = current_point.y + tile_size.y + tile_spacing.y;
// have we reached the end of the last row?
if (current_point.y >= (start_point.y + ((tile_size.y + tile_spacing.y) * num_tiles.y))) {
break;
}
}
}
3. So that I can center the item within a cell, is it possible to query the width and height of a sprite?
Thanks so much for your help!
Greg