How to make an expanding/collapsing "row" sort of like accordion
95orange
PRO Posts: 18
Hello all,
I'm having difficulty figuring out the best way to do this, so I thought I'd put it out there and see if anyone had any suggestions. I need to make a table (like an HTML table, not GS data table) with rows where you click on one and it expands to a certain "opened" height. Then when clicked again, it closes back to it's original height. There will be something like 100 rows like this in the table. It's sort of like an accordion menu, but where you can have any number of rows "opened" or closed at any time.
Now I realize this sort of thing is NOT optimal for gamesalad -- but the thing is, the rest of the game is very optimal for GS. So I'm trying to figure out the best way to do this.
So far, I've been trying to use a GS table to basically keep track of the Y position and opened heights of each row, then constraining each row actor's Y value to their row in the GS table. It works, sort of, but performance is an issue even with only a few rows.
I thought maybe using a collision/physics thing might enable any row to "push" the rest of the rows down smoothly, then maybe use gravity or something to pull them back up when they are closed. But the problem I'm having is that simply "growing" the row Y size when clicked doesn't trigger a collision right.. or so it seems. But maybe this isn't really the road I should be exploring.
Any ideas on how I could make this concept happen? TIA!
I'm having difficulty figuring out the best way to do this, so I thought I'd put it out there and see if anyone had any suggestions. I need to make a table (like an HTML table, not GS data table) with rows where you click on one and it expands to a certain "opened" height. Then when clicked again, it closes back to it's original height. There will be something like 100 rows like this in the table. It's sort of like an accordion menu, but where you can have any number of rows "opened" or closed at any time.
Now I realize this sort of thing is NOT optimal for gamesalad -- but the thing is, the rest of the game is very optimal for GS. So I'm trying to figure out the best way to do this.
So far, I've been trying to use a GS table to basically keep track of the Y position and opened heights of each row, then constraining each row actor's Y value to their row in the GS table. It works, sort of, but performance is an issue even with only a few rows.
I thought maybe using a collision/physics thing might enable any row to "push" the rest of the rows down smoothly, then maybe use gravity or something to pull them back up when they are closed. But the problem I'm having is that simply "growing" the row Y size when clicked doesn't trigger a collision right.. or so it seems. But maybe this isn't really the road I should be exploring.
Any ideas on how I could make this concept happen? TIA!
Comments
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
But it's not free, and it doesn't quite look like what I need. Perhaps it can be expanded/scaled to do what I need, but it really depends on how it's implemented. Just hoping to exhaust some other ideas before buying a template that may or may not help.