#✅ | Background Shifting Button

1 messages · Page 1 of 1 (latest)

feral orbit
#

I just want to have a button that when pressed, shuffles between 5 different backgrounds for menu

fading nightBOT
# feral orbit I just want to have a button that when pressed, shuffles between 5 different bac...

Hey there, Mark! 👋 That's a super cool idea for making your menus more dynamic!

You can totally create a button that cycles through different backgrounds. Here's a brief overview of how you can set that up using FancyMenu's variables and actions:

  1. Create a Variable: First, you'll need a variable to keep track of which background is currently active. You can create one via Customization -> Variables -> Manage Variables. Let's call it background_index and set its initial value to 1.

  2. Prepare your Layouts: For each of your 5 backgrounds, you'll create a separate layout. Each of these layouts will only contain one of your desired backgrounds.

  3. Assign Loading Requirements to each Layout: For each layout, you'll set a layout-wide loading requirement that checks the value of your background_index variable.

    • For the first layout, the requirement would be Is Variable Value and check if background_index is 1.
    • For the second, it would check if background_index is 2, and so on.

    You can set layout-wide requirements by right-clicking the editor background and selecting Loading Requirements [Layout-Wide].

  4. Create Your Button: Make a new custom button. The button's action script will increment the background_index variable.

    • You'll use an IF statement to check if background_index is 5. If it is, reset it to 1.
    • Otherwise, use an ELSE statement to increment background_index by 1.

    This will make the button cycle through your background layouts! You can find more details on how to set up this cycling logic in the documentation: Toggle Parts of Layouts.

This allows you to beautifully shuffle through your backgrounds with just a click! Let me know if you run into any questions while setting it up! 😊

feral orbit
#

is there a way to add a second button to Blur the background?

fading nightBOT
# feral orbit is there a way to add a second button to Blur the background?

Yes, absolutely! You can add a second button to toggle background blurring. 😊

Here's how you can achieve that:

  1. Introduce a New Variable: Create a new variable, let's say is_blurred, and set its initial value to false. This variable will track whether your background should be blurred or not.

  2. Add a Blur Background Option to your Main Layout(s): For each of your 5 background layouts you mentioned earlier, you'll need to configure a blur option.

    • Right-click in the editor background and select Set Background.
    • If you're using an Image background, go into its configuration. You should see an option for blurring. Here, instead of a static value, you'll use a placeholder that reads your is_blurred variable.
    • You'll likely use a Switch Case placeholder combined with your new is_blurred variable. If is_blurred is true, the blur value could be 5 (or any other desired blur strength); if false, it'll be 0.

    Here’s an example placeholder structure for the blur value (assuming a switch for blur strength):

    {"placeholder":"switch_case","values":{"value":"{"placeholder":"getvariable","values":{"name":"is_blurred"}}","cases":"true:5,false:0","default":"0"}}
    

    This will apply a blur of 5 if is_blurred is true, and 0 (no blur) otherwise.

  3. Create Your "Blur Background" Button: Add a new Button element.

    • Right-click the button and select Edit Action Script.
    • You'll want to toggle the is_blurred variable between true and false when this button is pressed. This is very similar to the "Toggle On/Off" example in the Toggle Parts of Layouts documentation. You'll set up an IF statement to check is_blurred. If it's true, set it to false; otherwise, set it to true.

By following these steps, your second button will gracefully toggle the blur effect on your backgrounds! ✨

feral orbit
#

can show me what the set variable value script would look like to set the variable back to1?

fading nightBOT
# feral orbit can show me what the set variable value script would look like to set the variab...

Of course! I can definitely show you that. 😊

To set a variable back to 1 using the Set Variable Value action in FancyMenu, the format is quite straightforward:

For the "Set Variable Value" action, you would enter:

background_index:1

Here's a breakdown:

  • background_index is the name of your variable.
  • : is the separator between the variable name and its new value.
  • 1 is the new value you want to assign to the variable.

So, if you're building an action script, for example, to reset your background cycle, you would use this line as the value for the Set Variable Value action.

feral orbit
#

thank you!

fading nightBOT
# feral orbit thank you!

You're very welcome, Mark! I'm glad I could help! 😊

Let me know if anything else pops up or if you have more questions as you continue customizing your menus. Happy designing! ✨

#
Thread Marked as Solved

This support thread has been marked as solved by @feral orbit.

The AI helper is now disabled, but you can still continue the conversation if needed. Thank you for using our support system!