Create an Inventory screen that follows the player

Get help using Construct 2

Post » Wed Sep 21, 2011 5:16 am

Hey guys, I loved Construct Classic so I made the purge and bought Construct 2, but I've run into a bit of an issue.

I'm trying to make an inventory that pops up whenever the player hits the "I" key. The items are displayed on a HUD layout with the parallax set to 0 so it follows the players. Once an item is clicked, it displays in the bottom right corner of the screen (also on the HUD layout), where the player can click on it so they can "use" the item.

I got everything working so far except for one thing: It seems the inventory doesn't follow the player. The icons stay glued to the screen in the same place, but clicking on them does not trigger the "Mouse colliding with" event. If I don't move the system works. I've tried spawning them on image points and have it set to "Always position sprite to image point X," but for some reason whenever they spawn them, they also spawn on the origin.

Is there a way where the player can move and it won't effect the events? Am I doing this wrong with a parallax layer? Any suggestions would help!

Thank you very much!
B
2
G
2
Posts: 2
Reputation: 1,004

Post » Wed Sep 21, 2011 2:22 pm

Can you post a .capx? Also, you might be running in to this bug in r57 - maybe try r56 and see if it works.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Sep 21, 2011 8:49 pm

Thanks for the reply!

I did get that bug, but I just fixed it by having an object always following the mouse and use that as the pointer.

Ran the file in the old and newer versions, but still no luck.

Here is the cap file: http://dl.dropbox.com/u/21096327/InventoryTest6.capx

Thanks again for the help!Ropewalker2011-09-21 20:50:24
B
2
G
2
Posts: 2
Reputation: 1,004


Return to How do I....?

Who is online

Users browsing this forum: theosciandra and 24 guests