Verse Library verse

01 Standalone

Toggles light shadow settings between normal and spooky modes when a trigger button is pressed.

verse-library/shadows/01-standalone.verse

// 1. Define the structure of our "Mood Switcher"
// This is like a blueprint for the device.
const MoodSwitcher := struct
    Light: LightComponent
    Button: ButtonDevice
    IsSpooky: bool = false // This is our "State Variable"

// 2. The Main Function: What happens when the button is pressed?
@init
main() =
    // We wait for the button to be pressed. 
    // This is an "Event" - like a trigger in UEFN.
    Button.PressedEvent.Subscribe(func(event):
        // Toggle our spooky state
        IsSpooky := !IsSpooky
        
        if (IsSpooky):
            // SETTING 1: Turn shadows darker (Gain)
            // Think of Gain as multiplying the darkness.
            Light.SetShadowGain(0.8)
            
            // SETTING 2: Tint shadows green (Offset)
            // Offset adds color to the shadow region.
            Light.SetShadowOffset(Color(0.2, 0.5, 0.2, 1.0))
            
            // SETTING 3: Increase contrast (make edges sharper)
            Light.SetShadowContrast(1.2)
            
            Print("Spooky Mode Activated!")
        else:

Sign in free to read the full source 🌴

This Verse Library file is members-only. Create a free account to view the complete source and download the .verse file.

Sign in with Discord

Comments

    Sign in to vote, comment, or suggest an edit. Sign in