[RESOLVED] Setting a list of layers

Get help using Construct 2

Post » Fri Mar 01, 2013 8:28 pm

Hi guys, I think I came up to the C2 borders. Anyway, better to ask that before thinking too much:

Is there a programming possibility to set/change i.e. same scale for a list of layers?? I've tried without success to write: "Layer0","Layer1",... under the Layer tab of Set scale action.XManBG2013-03-04 10:40:19
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Sun Mar 03, 2013 9:38 pm

Bump, I suppose that the silence means "No, there is no way for now..." And me personally, I couldn't find an intuitive way too.

Then please move that thread to the C2 suggestions topic. I believe that it would be very useful feature.
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Sun Mar 03, 2013 11:10 pm

Hi,

do you mean this?



B
45
S
15
G
9
Posts: 1,096
Reputation: 11,038

Post » Sun Mar 03, 2013 11:13 pm

There's no C2 suggestions forum D: ... And the silence doesn't mean "No, there is no way for now..." ... it means "What is he talking about ? perhaps he could explain more ... " For me atleast ...
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Mon Mar 04, 2013 12:08 am

Hei, thanks for asking, where could I know what the silence meant...

I have about 10 layers. I'd like to zoom in and out some of them (7), the rest remain as they are. So my zoom works with the layer scale action provided by the System object. I couldn't find a way to scale all 7 layers at once, but I'm writing seven times the sponglehammer suggestion. And that's every time I'd like to do something with those layers.

Now my question was if there is a way to do it as a list, I could imagine a solution which looks like:

Set LayerScale("layer0", "layer1", "layer2", etc) scale to XX.0

It's a pity, but that function didn't worked for me. How is it on your side, guys??
B
11
S
3
G
3
Posts: 79
Reputation: 3,343

Post » Mon Mar 04, 2013 12:29 am

You could use the function plugin zoom/unzoom in the 7 you want.

https://www.scirra.com/manual/149/function
B
6
S
1
G
1
Posts: 70
Reputation: 702

Post » Mon Mar 04, 2013 1:33 am

You should be able to scale the layout (Set layout scale), but set the "Scale rate" on the fixed layers to 0. This will scale all of your layers together, except the ones flagged as disabled (0).
ImageImageImage
B
67
S
19
G
124
Posts: 3,215
Reputation: 74,417

Post » Mon Mar 04, 2013 9:23 am

Thanks, this is what I call nice brainstorming...

@cincipon: Nice tip, I really haven't tested the Functions object until now and this could be a nice work around for such a problem. It works.



@blackhornet: Yes, you are right... The layout scale functions exactly as a scale of the list of all layers. Of course I have to set once the scale factor for each layer independently.XManBG2013-03-04 10:46:14
B
11
S
3
G
3
Posts: 79
Reputation: 3,343


Return to How do I....?

Who is online

Users browsing this forum: GSquadron and 28 guests