|
Post by Xenith on Apr 23, 2004 17:57:23 GMT -5
Can i get some help for a secret of mana rotating menu? or maybe a liitle help?
Vagueness removed by IA: it's like this all your items have icons like your candy(cure), cup of wishes(resurrect), and other things okay each has an icon and all of them are put in a circular order and whichever icon is on top is the one that is in selection and when either left or right is pressed the circle of icons rotates by 1 icon and the next one is in use. When you select an item it immediately gets used like a cure when selected. Each item's icon has a number besides it showing how many there are, when it reaches zero the icon of the item is then removed and all the item's in the circle are rearranged to make a perfect circle once again. And to obtain items you usually buy them or find in treasure chests. They are sorted in the order that they are collected.
|
|
|
Post by IsmAvatar on Apr 26, 2004 15:12:02 GMT -5
Ok. Then how? The most recent is on top? Then it goes clockwise?
Also, so I can get the circle size correct, how big is each item? 16x16?
Spring cleaning. Compliments of none other.
|
|
|
Post by Xenith on Apr 26, 2004 19:41:32 GMT -5
they are 16x16
|
|
|
Post by IsmAvatar on Apr 26, 2004 22:52:11 GMT -5
How about direction of sorting? The most recent is on top? Then it goes clockwise?
|
|
|
Post by Xenith on Apr 27, 2004 1:36:12 GMT -5
the most recent is on top
|
|
|
Post by IsmAvatar on Apr 27, 2004 11:21:48 GMT -5
then it goes clockwise, so the second newest is found just to the right of it?
|
|
|
Post by LanceHeart on May 2, 2004 18:31:01 GMT -5
IIRC, the SoM goes both ways, you can scroll through them with the arrows, meaning you'd have to make each arrow hit get the next item for the direction you want.
I've yet to find a way to do that, all I wanted to point out is that the menus scroll both ways and animate both ways when they rotate.
|
|
|
Post by IsmAvatar on May 2, 2004 20:36:16 GMT -5
Yes, I figured it goes both ways. IIRC? what's that?
When I said clockwise, I meant the way they are sorted. Are they sorted so that the second newest is one space clockwise from the newest?
|
|
|
Post by LanceHeart on Jun 13, 2004 22:17:29 GMT -5
Ah, of course.. Well, in the SoM games there's a nice little effect making the images shrink and slide behind the character progressively as you scroll through the options. It's chronological, the effect isn't hard to produce, either. The option that fades behind the character is only because the sprite of the character overlaps the other sprite...
|
|
|
Post by Xenith on Nov 4, 2007 17:43:12 GMT -5
Sorry, for resurrecting a dead topic but..... The above animation is when you cycle through, notice that all sprites in the inventory are equally spaced(I think). Also note that one object is always at the very top inside of the reticle. This one is the animation that plays when you exit your inventory. They all spread out, but not in a straight line, they seem to curve like a throwing star, I guess. These last ones are to show how the inventory looks with more or less items. So basicly, I'm not quite sure how to approach this. I think that even though I've never attempted an inventory system in GM before, that I already have an idea to get that working. The most boggling thing for me right now is getting all these sprites to rotate around the character by around 24 pixels, while still being evenly spaced and having one object always higher up to be within the reticle. I looked around and I think, the length_dir and length_dis will be good options. Any ideas?
|
|
|
Post by IsmAvatar on Nov 4, 2007 22:10:37 GMT -5
Yes, lengthdir_x and lengthdir_y are the options you want. First, you'd want to know how many objects there are. This may or may not effect the size of the circle (again, not familiar with the game), but anyways if it does, you'd want to keep a variable for the distance from center. Next, you'd need to calculate the angular spacing between items. This would simply be 360 / item_count. Then finally, you'd simply create a loop and increment the cur_angle by angular_spacing, and place each object at angle: cur_angle and distance: <enter distance here, or distance variable>. You'll also want to watch out for an angular offset (e.g., angle 0 = right, angle 90 = top. So if you want to start on top, offset by 90) and traversal direction. By default, this traversal will be counter-clockwise. If you wish for it to be clockwise, you'll either need to negate the cur_angle or angular_spacing, or traverse the items from last to first.
|
|
|
Post by Xenith on Nov 5, 2007 16:04:30 GMT -5
-Okay, so if I have 7 icons, should they all be created as separate objects,or all just drawn from one object. (Which would be more effective or simpler?) -As far as I can tell, the circle is always the same size. I think they a 24 pixels away from the center. Also, how would I go about getting the distance from the center? Should I create an invisible object for the center of the circle? -Before I posted here I was trying to find anything in the manual for putting objects at a certain angle. When I seached for angle or rotate, it was always related to rotating a sprite or rotating a 3d model. -Angular spacing = 360/item count,I don't see a reason for it to refresh the number, so I guess that goes in the create event. -If you don't mind, could you give me a little more info on that??^^ would cur_angle be a variable I come up with, or is that an actual function in GM? If it was a variable that I create, how would I get cur_angle's values? -Could you also give me a little more info on this? Sorry
|
|
|
Post by IsmAvatar on Nov 6, 2007 1:35:46 GMT -5
When I create inventories, there's no way to know until I actually get about halfway done the inventory, whether it's going to be individual objects for each inventory item, or 1 object drawing each sprite. It really depends on what kind of functionality you need. I'd highly recommend 1 central object and then draw all of the items sprites. But if this doesn't offer the functionality that you need (e.g. you may find the spiraling effect difficult), you might want to go over to objects instead. Objects complicate things because then you'll need to determine whether items should have a special case of themselves for the inventory (e.g. if inventory = true), or should you just have a second object type for each inventory item.
See my answer above. If it's always 24 pixels, your space will get very scrunched (squashed) very quickly. You shouldn't need to get the distance from the center, since you've just stated yourself that it is 24 pixels.
Did you try searching for "dir" or "direction"? This might yield the lengthdir_x and lengthdir_y functions.
If the number of the items in your inventory never changes for the lifespan of this particular object, then yes, create event is sufficient.
the later information is your further explanation of the prior information. It's really hard to explain this in words when its best shown with pictures of circles. If only I could share a doodle pad with you, so I could draw and explain what I'm drawing at the same time, but of course this is not reasonable, so I'll have to suffice with what I have. Maybe tomorrow I'll draw up some pictures and post them for you.
|
|
|
Post by Xenith on Nov 7, 2007 12:36:44 GMT -5
Sorry for the late reply, I was a little preoccupied. I don't think I got as close to what you said. I overcomplicated what I did, not really sure how to get it to work in a more simplified way. I'd post the code, but I'd think that it would just make it harder to understand. Is it alright if I send you a link, and you take a look at it? I don't really want you to edit it, but I want some criticism or pointers.
Also, instead of cycling in an animated fashion, the way I go it right now, makes the objects just jump to the next position. Know how to fix that?
|
|
|
Post by IsmAvatar on Nov 7, 2007 15:50:03 GMT -5
Sure you can link. Just remember that if you post here, anyone can see your link, being a public forum and all (not that anybody really visits these forums anymore, anyways)
|
|