Slider set value #525
Replies: 2 comments
-
Can you post a screenshot of how the outcome looks? |
Beta Was this translation helpful? Give feedback.
-
Hi, Stephan! you can use ags Variables to achieve that: ...
// somewhere in your code
const sliderVar = Variable(3 /*initial value*/);
...
// in your slider code
onChange: ({ value }) => print(value),
value: sliderVar.bind(), // We're binding to our Variable.
min: 0,
max: 10
... Now the slider value will be changing automatically every time you change the
Something like, I suppose: const proc = Utils.subprocess(
// command to run, in an array just like execAsync
['bash', '-c', 'path-to-bash-script'],
// callback when the program outputs something to stdout
(output) => print(output),
// callback on error
(err) => logError(err),
) You can read about this here: https://aylur.github.io/ags-docs/config/utils/ |
Beta Was this translation helpful? Give feedback.
-
Hi AGS users,
I have started to learn ags.
I have added a slider widget to a box and I am trying to set a default value to a slider.
Widget.Slider({
onChange: ({ value }) => print(value),
value: 3,
min: 0,
max: 10
}),
But the slider doesn't show 3 as value. It is still at 0.
How can I change it?
In addition I want to load the value from an bash script. How can I set this up?
Beta Was this translation helpful? Give feedback.
All reactions