tweak(path, options)tweakables.js:57Add a value to the tweakables panel, so it can be changed while the game runs
- The path is the name of a global, or a dotted path to a field on one like 'player.speed'
- Only globals of a script can be found by name, an ES module game passes the object its values are on
- Its type comes from the value it has now: a number, boolean, Color, Vector2 or Vector3
- Call it after the value is set, at the end of gameInit
- Adding the same path again keeps its row and brings its tweaked value back, for an object made again; with the object option it is known by its label, so two objects with the same field need their own labels
- Does nothing in release builds
pathstringName of a global, or a dotted path to a field on one or on the object option
optionsTweakOptions optional
tweak('jumpSpeed', {min: 0, max: 1});
tweak('skyColor');
tweak('player.size', {label: 'Player Size'});
tweak('speed', {object: settings}); // settings.speed, in an ES module