Night Mode Toggle - UQcsse3200/2024-studio-2 GitHub Wiki
Night Mode Feature Documentation
Overview
The Night Mode feature allows users to toggle between a standard Day Mode and a visually darker Night Mode for the game's main menu. This feature helps reduce eye strain in low-light environments and provides users with an alternative visual experience.
Key Components
1. Flag Variable:
isNightMode
:
A boolean flag that tracks whether the Night Mode is currently enabled.
2. Textures:
lightBackgroundTexture
:
Stores the texture for the standard Day Mode background.nightBackgroundTexture
:
Stores the texture for the Night Mode background.
Implementation
Toggle Button:
A TextButton
is added to the top left corner of the screen to allow users to toggle between Day and Night Mode. The button text dynamically changes between "Night Mode" and "Day Mode" based on the current mode.
Visuals