#gamedev #gui #const

macro const-tweaker-attribute

Tweak constant variables live from a web GUI

7 releases (4 breaking)

0.5.0 Apr 13, 2020
0.4.1 Mar 28, 2020
0.3.0 Mar 22, 2020
0.2.0 Mar 22, 2020
0.1.1 Mar 21, 2020

#11 in #web-gui

Download history 57/week @ 2023-10-30 44/week @ 2023-11-06 41/week @ 2023-11-13 51/week @ 2023-11-20 46/week @ 2023-11-27 42/week @ 2023-12-04 38/week @ 2023-12-11 47/week @ 2023-12-18 53/week @ 2023-12-25 22/week @ 2024-01-01 40/week @ 2024-01-08 41/week @ 2024-01-15 35/week @ 2024-01-22 53/week @ 2024-01-29 37/week @ 2024-02-05 63/week @ 2024-02-12

191 downloads per month
Used in 3 crates (via const-tweaker)

AGPL-3.0-or-later

16KB
425 lines

const-tweaker

Tweak const variables live from a web GUI.

CI Version Rust Documentation License


This library opens a web interface when the application is run, allowing you to change the values of constants in real time. It's especially useful for gamedev where you want to tweak some variables without introducing a hot-reloading scripting language for it.

After running your application the web GUI to change constants is opened at 127.0.0.1:9938.

Example

// Create a slider to tweak 'VALUE' in the web GUI
#[const_tweaker::tweak]
const VALUE: f64 = 0.0;

fn main() {
	// Enter a GUI/Game loop
	loop {
		// Print the constant value that can be changed from the website
		println!("VALUE: {}", VALUE);

		// ...
	}
}

Dependencies

~1.5MB
~40K SLoC