Help/Advice with menus

Hi again everybody, sorry to be a pain but im really struggling with this one…

I have an ‘Inventory menu’ within my game which allows me to add various power ups etc etc…all works great with regards to adding the items, but im having problems with actually placing them (by dragging) to my main object group. The Inventory Menu is in one group, when i drag an item from my iventory menu over my object group its meant to add it to that group, which works to a certain degree, however as a user can scroll the group, when you drag an item it places it off the screen if the object group has been scrolled to x other than the original position.

Any ideas??

Also is there a clever way i could create my inventory menu by code depending on the items i want to add to it at the start of a level? As each level will require a different number of power ups it would be nice to have the inventory menu dynamically created instead of having to create it and position the items every level.

Hope this makes sense.

And thanks again for all your help. [import]uid: 162458 topic_id: 29709 reply_id: 329709[/import]

Kind of hard to follow the exact question but I’ll take a stab at it. When getting x/y values between two different groups(and more specifically when either of those groups can move) you just need to apply an offset.

[lua]myItem.x = myItem.x - myObjectGroup.x
myItem.y = myItem.y - myObjectGroup.y[/lua]

I use something like that when trying to get the X/Y coords of a touch inside of a group that is moving around.

As far as question 2, goes, I’m sure there is but it’s a rather broad question.
[import]uid: 147305 topic_id: 29709 reply_id: 119232[/import]

thanks for taking the time to reply. I will try the offset method asap. As to the second question, i had the idea of maybe creating a separate lua file to handle adding and displaying my inventory menu items, i.e re-sizing the menu, adding/removing items and adjusting to suit. [import]uid: 162458 topic_id: 29709 reply_id: 119496[/import]