How Do I Make Scrolling Slots For An Inventory?

0 favourites
  • 12 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • 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?

  • Happy Thanksgiving Bro,

    Ima bump this thread because i need this info aswell.

    im surprised nobody has helped you yet.

  • 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 :)

  • 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.

  • 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..

    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.

  • Agree with boony.

  • 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.

    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.

  • 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?

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • jayderyu

    Thank you for explaining that to me.This is all i really needed to know. It will be alot easier with some of this information you have given me.

    Thank You.

  • No Problem,

    I see you got aid/help. Sorry didn't offer any myself. I was running short on time yesterday. I agree with setting tile frame/animation.

    It looks good, interesting way on handling Inventory.

    No need to feel foolish, we all have different strengths and is totally dependent on what you have done previously. We can't all be experts on everything.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)