#✅ | Background Shifting Button
1 messages · Page 1 of 1 (latest)
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:
-
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 itbackground_indexand set its initial value to1. -
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.
-
Assign Loading Requirements to each Layout: For each layout, you'll set a layout-wide loading requirement that checks the value of your
background_indexvariable.- For the first layout, the requirement would be
Is Variable Valueand check ifbackground_indexis1. - For the second, it would check if
background_indexis2, and so on.
You can set layout-wide requirements by right-clicking the editor background and selecting
Loading Requirements [Layout-Wide]. - For the first layout, the requirement would be
-
Create Your Button: Make a new custom button. The button's action script will increment the
background_indexvariable.- You'll use an
IFstatement to check ifbackground_indexis5. If it is, reset it to1. - Otherwise, use an
ELSEstatement to incrementbackground_indexby1.
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.
- You'll use an
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! 😊
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:
-
Introduce a New Variable: Create a new variable, let's say
is_blurred, and set its initial value tofalse. This variable will track whether your background should be blurred or not. -
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_blurredvariable. - You'll likely use a Switch Case placeholder combined with your new
is_blurredvariable. Ifis_blurredistrue, the blur value could be5(or any other desired blur strength); iffalse, it'll be0.
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
5ifis_blurredistrue, and0(no blur) otherwise. - Right-click in the editor background and select
-
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_blurredvariable betweentrueandfalsewhen 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 anIFstatement to checkis_blurred. If it'strue, set it tofalse; otherwise, set it totrue.
- Right-click the button and select
By following these steps, your second button will gracefully toggle the blur effect on your backgrounds! ✨
can show me what the set variable value script would look like to set the variable back to1?
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_indexis the name of your variable.:is the separator between the variable name and its new value.1is 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.
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! ✨
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!