> > Well, I never tried, but I think doing a matrix (array) is the best way.
> > A time ago I did a grid system on my canvas, this example may help you to position your sprites on the canvas and change their position while changing the weapon.
> > First, you need to have an idea of how bigger will the the selection menu area. For example we will have a layout for this menu with the size of 100x100 pixels, this place is where our sprites will rotate around.
> > Then, grid it. Your sample have a grid of 4 slots on the horizontal and 5 on the vertical, so, each slot size is: 25x20 pixels;
> > Make your grid with math. You can construct on the begin of the screen and manipulate it later.
> > For the first 4 items:
> > >> On layout start:
> > >> item.ID < 3 (because id 0 is the first):
> > >> >> create item.ID on Layer 0;
> > . >> X = item.ID*LayoutWidth/4-LayoutWidth/2;
> > . >> Y = item.ID*LayoutHeight/5-LayoutHeight/2.5;
> > This code will place the first 4 items on the first line of your layout (layout here means the menu area).
> > Well, you can make it with infinite ways, this is the first way I may try (or doing animation sprites and calling the frames one by one, where the frame number coincide with the item slot on the item list of your sample ^^)
> I have a question about item.ID where ID starts, i was almost confused, i'm not sure you mean IID, UID or just instance variable?
> Anyways, i made a .capx which is buggy, maybe you can check to correct it, you can press by right or left arrow... thanks! :)
I-m at work now, but that ID is an instance variable. You can set unique instance variables as IDs when creating any object by this way:
>> GlobalID = 0;
>> Any event trigger:
> >> Create object on X,Y;
> >> Set object.ID to GlobalID;
> >> Set GlobalID = GlobalID + 1;