const-tweaker

Crates.ioconst-tweaker
lib.rsconst-tweaker
version0.3.1
sourcesrc
created_at2020-03-15 21:29:58.583421
updated_at2020-04-13 09:52:16.961782
descriptionTweak constant variables live from a web GUI
homepage
repositoryhttps://github.com/tversteeg/const-tweaker
max_upload_size
id218997
size783,072
Thomas Versteeg (tversteeg)

documentation

https://docs.rs/const-tweaker

README

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);

		// ...
	}
}
Commit count: 67

cargo fmt