How do I set a value from an Sprite parameter to slide bar?

Get help using Construct 2

Post » Thu Jul 16, 2015 2:20 pm

I'm doing a shader generator on the user can modify the aspect in real time using the "slider bar" and text boxes.

How can i get that when the layout is started> set the slide bar value of X parameter.

The object have an efect called "Fire". The fire effect have 26 parameters (0 to 25). The idea is that when the layout is started the slide bar get the value of them.

I already have a for that "on change" the slider the parameter change but obviously all the alider bar starts on 0. So i need that when the layout is started the slider value gets the initial value of each parameter but i can't find nothing ¿?.
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Thu Jul 16, 2015 2:24 pm

If you are using the slider bar object, isn't this as simple as using the action "set value"

And there is no reason for the slider bar to start at 0 for you can change the maximum value, minimum value and value at runtime..
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 » Thu Jul 16, 2015 2:29 pm

I know, i can "set value" of the Slide Bar of something, the problem is that i not find where is the parameter of each variable of the effect to say "set value".

In the options, i have "set value" of the Opacity object, Angle, X, and a lot of them but i can't find how to set the value of any parameters of some effect added to the object.

yes i also now the minimu/maximun value at start, also the maximun steps,etc.... the problem is set the slider to the same number of the effect parameter.

Edit: This:

How i can set to the slider at the start of the layout the parameter of some effect?
Image
Last edited by matriax on Thu Jul 16, 2015 2:35 pm, edited 1 time in total.
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Thu Jul 16, 2015 2:35 pm

I'm not sure if it's possible to call them directly, but you could ofcourse use instance variables for them and use the set effect parameter to instance variable, than you could change the instance variable with the slider..
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 » Fri Jul 17, 2015 1:22 pm

So if i have 40 sprites with 25 parameters each one i have to go one by one sprite and one by one parameter passing as instance variable? :S .

I tried from yesterday another solution and nothing, I finally simply set at start layout the value of each Slidebar with the sprite reference while i find a better way, at least i can test the editor/configurator with one sprite.

Maybe this will be a good idea for a feature request, i saw you can get a lot of information from a sprite but nothing from the effects parameters.

So, there is no way to set automatically with one event using "for each" the values of each slide bar from some Effect Parameter of the sprite right?.
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Fri Jul 17, 2015 1:49 pm

I'm guessing you could make a function to do this (that way you only have to write the actions once), maybe even using an array per sprite in a container and having it's values read instead of having to create a seperate action for everything..
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


Return to How do I....?

Who is online

Users browsing this forum: dop2000, tarek2 and 16 guests