How Do I Make Scrolling Slots For An Inventory?

Get help using Construct 2

Post » Thu Nov 28, 2013 6:57 pm

Happy Thanksgiving!

I have a question about inventory's. I am trying to create a scrollable set of slots on my inventory layer pinned to my custom menu.How would i attach such a thing?
I basically want the player to have a scrolling slot list for the inventory that will be hidden along with my inventory menu.could someone help me?
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Fri Nov 29, 2013 2:12 am

Happy Thanksgiving Bro,

Ima bump this thread because i need this info aswell.
im surprised nobody has helped you yet.RookieDev2013-11-29 02:12:37
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Fri Nov 29, 2013 10:01 am

It's really quite simple if you break it down into the component parts ..I think what you are really asking is.."Could someone make this for me because I cant be bothered"

First of all, aside from your greeting, you made 3 statements and asked 2 questions in relation to those 3 Statements...I'm going to Ignore Rookie Devs statements as his comments really did nothing at all to add to a solution...

The First part is easy..your question said Quote
"I am trying to create a scrollable set of slots on my inventory layer pinned to my custom menu."

Your question was "How would i attach such a thing?"

First of all you NEVER NEED TO attach objects to other objects in order to change their visibility on screen..
But if you want to change the visibility or any other behaviour of a group of objects you want to read up on FAMILIES..
Keeping in mind that FAMILIES only group together similar objects
like TEXT,Sprites or Particles for example but not together in the same group

ONLY similar objects can be in the same Family..for example:

A Family of 'TEXT' objects that describe your Inventory items

or

A family of 'Sprites' that display your Inventory items visual appearance

So a little pre-planning should sort that out any problems there for you..

Now I'm going to presume you already have made your scrolling slots because you didn't say that you hadn't, rather you only asked about how to attach it somehow it to your custom menu so as to allow it to be Hidden at the same time as your custom menu..

So the easy Answer there is...make or use your pre-existing Scrollable set of Slots then group them as a container or FAMILY and Then use the "PIN Behaviour" to pin them to the menu..Personally I would use FAMILIES to do so as its much more flexible once you understand how to use it...if you dont know how to use FAMILIES..The Manual has a perfect explanation of its usage. You could also if you like..rather than use the PIN behaviour you could make an EVERY TICK event set position to Custom Menu..

But of course I'm also going to presume that you are using a normal or standard basic menu set-up that DOESN'T move around the screen only appears visible or not visible in which can pinning is irrelevant..because you menu doesn't move at all does it?


BUT...

If you are only making your menu items 'Visible or not visible'
Then pinning your scrolling slots is kind of not necessary..a red herring I wouldn't look there...

So to pre visualise what your real question is about...
I m going to ignore RookieDevs comments as I am fairly certain he is asking how to make a scrolling inv from scratch ..I could be wrong

The NewGuy, Am I also wrong when I say that you haven't even built the Scrolling Slots and in fact this is what you really want help with?

ie" You haven't made the scrolling slots yet?

Which is more or less what RookieDev seems to have made the question about..although this may of been his error not yours...
I doubt that two people simply wish to know how to use the PIN or FAMILY behaviour when Both are clearly discussed in the Manual..

So...The NewGuy....If you want help with how to make a scrolling Slots function for your inventory trying asking more specifically for that rather than how to pin an existing one to your custom menu.
if you just want to pin it...first of all ask yourself...Do I really need to attach it....if you menu isn't moving at all on the screen canvas...you wont need it...Pinning is mainly for fixing the location or rotation of objects in relation to another in either a fixed style semi fixed(Bar) or a looser style of pinning(Rope)

So if all you want to do is attach your scrolling slots to your custom menu...first off ask your self if you really need to ..does your menu move around on the screen..if so then yes you do probably need to pin your scrolling slots to it..if the menu doesnt move ..there should be no reason to attach it..unless of course you are having issues with screen size and placement etc which is really another question entirely..
If on the other hand you want to know how to make a SCROLLING SLOT Inventory...perhaps you should ask for that ..or ask for an example of one....if all you want to do is "HIDE" the Scrolling Inventory slots which is what you actually asked for...then why not just use the IS visible event call at the same time as when you make "VISIBLE" the Custom menu...its quite easy to add an extra event... Your question is ok...but I think RookieDev is actually after a different question..I could be wrong..

Happy Thanksgiving :)
mystazsea2013-11-29 10:18:16
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Fri Nov 29, 2013 3:33 pm

Use a root object and pin your items or a gfx item representation to it. Then move your root object.

If you have an image or example of what your looking for I can give better details.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Fri Nov 29, 2013 6:13 pm

[QUOTE=mystazsea] It's really quite simple if you break it down into the component parts ..I think what you are really asking is.."Could someone make this for me because I cant be bothered"

First of all, aside from your greeting, you made 3 statements and asked 2 questions in relation to those 3 Statements...I'm going to Ignore Rookie Devs statements as his comments really did nothing at all to add to a solution..
[/QUOTE]

All he did was ask for help. He didn't state whether the help needed to be a visual example, written explanation or combination of both. Since it's harmless to ask a question, and you are not required to take time out of your schedule to help, I don't see any reason for you to be so upset and condescending. If you have such conflicted feelings about helping people, why even read the "How do I..." forum? The name of the forum begs for questions like these.
B
14
S
3
G
1
Posts: 87
Reputation: 1,108

Post » Fri Nov 29, 2013 6:47 pm

Agree with boony.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Fri Nov 29, 2013 7:42 pm

@jayderyu @Boony @DUTOIT

Thank you guys for sticking up for me,I know I might not be the best at explaining things but for him to go all mad on me kinda made me feel dumb.
I know that im not the smartest when it comes to using construct yet but im trying.

http://wiki.minetest.net/images/3/35/Inventory_menu_illustrated.png
I added a link to what im basically trying to do.
I already know how to use arrays in a basic way I just dont understand how to make them scroll up and down within the inventory.
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Fri Nov 29, 2013 7:54 pm

hmm. That starts to help. Another question in relating to your up and down.

Do you mean the Inventory BOX is going up and down with your entire inventory OR do you meant that you have more than 4 rows of inventory and you need to scroll through them?
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Fri Nov 29, 2013 8:00 pm

@jayderyu

My apologies I ment if i have more than four rows of inventory I would like to scroll through them.
Im just trying to make better sense of how it all works together.Thank you once again for offering your assistance to me.TheNewGuy2013-11-29 20:36:34
B
9
S
5
Posts: 126
Reputation: 1,295

Post » Fri Nov 29, 2013 8:43 pm

ok. Well C2 isn't very good at cutting out images on a scrolling system. The best way for such a thing is to put an image on top. For what your looking for you couldn't scroll them graphically through the top as the top hider image would also hide the game screen :\. You can check the iScroll plugin.

However you can iterate through your array lists and redraw what's seen.

variable(store wherever)
var current_row = 0;

Pop the inventory box onto the screen.
repeat(col * rows)
--> create inventory_tile
--> set tile frame/animation to Array.atValue(loopindex + (current_row * 8) )
--> set inventory_tile.xy(loopindex % 8 * width + offset_X, loopindex / 8 * height + offset_y)

When you need to change. Change the current_row value, destroy the current icon tiles. Redraw loop.

That's the principle idea of scrolling through. this was just a quick guide. Nothing detailed so I am probably a smudge off on my math formula.
jayderyu2013-11-29 20:45:32
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Next

Return to How do I....?

Who is online

Users browsing this forum: 8tomo8, brunopalermo and 10 guests