How do I add description for every item in my inventary

Get help using Construct 2

Post » Wed Dec 03, 2014 12:54 pm

Hello,
I made this inventory without arrays based on another tutorial.
I add:
+ Action when the inventory is full
+ Platform dropping function

(If someone want a tutorial, I could do it)

Now, my doubt (I uploaded the .capx)
I want you to help to add a description for every item when my mouse or something is over this item. I mean: When the apple is in the inventary and my mouse is over the item (While it is in the inventary (the item is an animation in fact)) show the description. Any ideas? :D
Thanks so much

(sorry for my english ;) )
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 28
Reputation: 652

Post » Wed Dec 03, 2014 4:26 pm

I took a look at your program and I added an instance variable to your object and an event to move and display text when that object is tapped. Since your example has a filled slot animation rather than moving the item, this only works when the item is clicked before it's moved. Since you chose to use the "touch" feature, there is no "mouseover" event and I made the event to act in a manner appropriate to a touch interface.

However, I want to make some big recommendations on to how you're handling this:
* Make your apples and pears separate objects. You can add them to a family so you can change your events so when the player collides with a member of the family it picks them up.
* Rather than have a separate sprite for a box with an apple or pear in it, move the object to the box. This simplifies a lot of the events, removes the need for most of the instance variables, and simplifies the need for assets. This way you'll only need 2 sprites for the box (empty and the highlighted one) and you could use an arbitrary number of objects as pickups.
You do not have the required permissions to view the files attached to this post.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Wed Dec 03, 2014 6:35 pm

hey! Thank you so much, but that wasnt what I want, I wanted the description when the object is in the inventory.
Thanks for the recommendations, I tried to make what you say, but:
If I make 2 separate objects, when I make the evento to move the family item to the box, all the obejcts are move to the box and not only the object i colliding with. I dont know how to do this =S!
Thanks again anyway! :) @Mylon
B
7
S
1
Posts: 28
Reputation: 652

Post » Wed Dec 03, 2014 7:32 pm

When you create your event you need to "pick" the object to make sure you're using the right one.

I updated the project file to show you how to move the objects around and reduce the number of events and required.

Unfortunately I'm running into the very same problem of picking the right inventory box so I can't quite figure out how to mark one box (and not all of them) as full to prevent picking up more than 2 items at once.
You do not have the required permissions to view the files attached to this post.
B
10
S
2
G
2
Posts: 73
Reputation: 1,044

Post » Fri Dec 05, 2014 8:47 am

OH! ok, thank you so much for your help @Mylon! :)
B
7
S
1
Posts: 28
Reputation: 652


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests