11 releases

0.3.1 Apr 13, 2020
0.3.0 Apr 13, 2020
0.2.6 Apr 12, 2020
0.2.5 Mar 27, 2020
0.1.1 Mar 16, 2020

#1667 in Game dev

Download history 3/week @ 2023-11-20 2/week @ 2024-01-08 5/week @ 2024-02-12 17/week @ 2024-02-19 41/week @ 2024-02-26 23/week @ 2024-03-04

86 downloads per month
Used in 2 crates

AGPL-3.0-or-later

410KB
612 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

~13–27MB
~441K SLoC