creating objects in menu

Get help using Construct 2

Post » Mon Feb 01, 2016 4:29 pm

So I'm using a bunch of different menus in the game I'm making (for touch screen). And the way I do them is by having a background and items on top that are pinned to the background, and a vertical drag and drop behavior on the background. It works well, but the amount of events I have to have for every menu is going to be crazy!
I'm wondering if there is a way to make it more efficient maybe.
Right now I'm creating the background object, creating all of the menu items (it's going to be a whole lot of them later) one by one with the different Y-positions. Then I have to pin each one to the background. I've put the menu items in a family and tried to pin the family to the background but it refused to work so I'm doing it one by one..
And then of course the events for each menu item that tells them what to do when I press them.
I don't know if there is any other way to do it, but I thought I should ask at least!
Maybe some smart way to create them and position them below each other without having to do it one by one or something?
B
10
S
3
Posts: 62
Reputation: 774

Post » Mon Feb 01, 2016 4:58 pm

I don't think there is a simple way (you need to put the information somewhere, no matter what). Maybe you can find some regularities (for example, many menus contain a column of 50x200 pixel buttons; then you could do some sort of preset function that knows the position and you just tell it which animation to show for the first, second, third, and so on button).

Pinning families works. I guess you do something wrong.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Mon Feb 01, 2016 5:27 pm

Ok I'll have to think about that, maybe I'll just accept the amount of work I have to do for each menu :)

Could you maybe take a look at this and tell me what I'm doing wrong with pinning the family? https://dl.dropboxusercontent.com/u/624 ... ample.capx

Thank you so much for your help btw!
B
10
S
3
Posts: 62
Reputation: 774

Post » Mon Feb 01, 2016 5:42 pm

I usually use a dictionary object, repeat tokencount times, create tokenat(loopindex)..

Quick Example
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Feb 01, 2016 6:12 pm

LittleStain wrote:I usually use a dictionary object, repeat tokencount times, create tokenat(loopindex)..

Quick Example


Cool! A tad bit advanced for me maybe, plus each item on my menu is a tiled background image that is different from each other so I think that makes it a bit more complicated maybe!

But if I can get the object family to pin to my menu bg it would help alot at least! Don't understand what I'm doing wrong there..
B
10
S
3
Posts: 62
Reputation: 774

Post » Mon Feb 01, 2016 6:42 pm

Just add a "system wait 0" action before the pinning action..
That way the pinning is delayed untill after the tick, when all objects actually exist..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Feb 01, 2016 8:04 pm

Thank you thank you! Now at least I have one less step to do for each menu item.
I suppose there are ways to do it more efficiantly but I think I'm to much of a newbie to figure them out, so I'll stick with the method I'm using now. It will be fine. Thanks so much for all your help, this forum is the best!
B
10
S
3
Posts: 62
Reputation: 774


Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 16 guests