#✅ [SOLVED] Ticker with a variable duration

1 messages · Page 1 of 1 (latest)

crystal adder
#

Is it possible to set an interval of a ticker with a variable (for example i made a customized background wich changes with a ticker.) and in my "menu preferences" i put a slider for the interval duration between each background. The ticker have an option "Ticker duration (in ms)" is it possible to write the result of a variable (in this case the slider) inside of it ?

pastel ploverBOT
# crystal adder Is it possible to set an interval of a ticker with a variable (for example i mad...

Hello there, enzoeyere! 👋

Yes, that's absolutely possible! You can dynamically set the interval duration of a Ticker element using a variable, which can be controlled by a slider. Many of FancyMenu's inputs, including the "Ticker duration (in ms)" field, support placeholders for dynamic values.

Here's how you can achieve this:

1. Set up your Slider to control a variable

First, ensure your slider is correctly set up to store its value in a FancyMenu variable. For example, if your slider's action script uses set_variable to update a variable named background_interval:

  • Variable Name: background_interval
  • Slider Action: set_variable with value background_interval:$$value

This means that whenever the slider's value changes, the background_interval variable will be updated with the new duration.

2. Use the Variable in your Ticker's Duration Field

Next, go to your Ticker element:

  1. Right-click the Ticker element.
  2. Go to the "Tick Delay (in ms)" field.
  3. In this field, you can insert a placeholder that retrieves the value from your background_interval variable. It would look something like this:
    {"placeholder":"getvariable","values":{"name":"background_interval"}}
    
    You can click the "Placeholders" button in the text editor (top-right side) to easily generate this.

Now, your Ticker's duration will always be controlled by the value stored in the background_interval variable, which your slider updates!

This way, users can adjust the background change interval directly from your "menu preferences" screen. Let me know if you run into any snags while setting this up! 😊

You can find more information about variables and placeholders in the documentation here:

crystal adder
#

theres no placeholder buttons, will it work anyways ?

pastel ploverBOT
# crystal adder theres no placeholder buttons, will it work anyways ?

Oh, I see! You're right, for single-value input fields like "Tick Delay," there might not always be a "Placeholders" button. My apologies for that oversight! Sometimes, it's hidden to keep the UI clean, or it might not be implemented for that specific input field.

However, even without the button, it's often the case that you can still manually type placeholder JSON directly into the input field! The screenshot shows a text input field, so there's a good chance it will accept the placeholder JSON.

Could you please try typing the exact placeholder JSON I provided earlier into the "Tick Delay [ms]" field?

{"placeholder":"getvariable","values":{"name":"background_interval"}}

Just make sure to replace "background_interval" with the actual name of the variable your slider is using.

After typing it in, press "Done" and test if the Ticker responds to changes from your slider. If it does, then it means the input field supports placeholders even without the button! 😊

crystal adder
#

the text input only accepts numbers, i think its not a feature then

pastel ploverBOT
# crystal adder the text input only accepts numbers, i think its not a feature then

Ah, I understand. If the input field only accepts numerical values directly (as your screenshot implies and your recent message confirms), then unfortunately, it cannot directly use a placeholder for the variable. This means the field is designed for static numeric input only, not dynamic content.

My apologies—I was hoping it would accept placeholder JSON directly without the helper button.

In this specific case, if a Ticker's delay input cannot directly take a placeholder, you cannot dynamically set its delay based on a variable or slider value. The "Tick Delay [ms]" setting would need to be a fixed number.

Could you tell me what you're trying to achieve with the changing background? If it's to have different backgrounds over time, there might be other ways to achieve a similar effect, perhaps by using multiple Image elements with loading requirements that check the slider's variable. However, this would involve toggling visibility rather than changing the refresh rate of a single element.

Is there any other information I can provide about Tickers or other elements that might help you achieve your desired background effect?

#

✅ [SOLVED] Ticker with a variable duration