Skip to content

Settings Object

jackcarey edited this page Jul 16, 2022 · 1 revision

The global Controller() object and each controller instance get an instance of GC_Settings() stored in their globalSettings and settings attributes, respectively.

Individual ettings can be accessed and updated directly as attributes of the globalSettings or settings attribute1.

→ Read about the available settings.

Example

// Global

console.log(Controller.globalSettings.useAnalogAsDpad);
>> "none"

Controller.globalSettings.useAnalogAsDpad = "both";
console.log(Controller.globalSettings.useAnalogAsDpad);
>> "both"
// Per-controller
var controller = Controller.getController(0);

console.log(controller.settings.useAnalogAsDpad);
>> "none"

controller.settings.useAnalogAsDpad = "left";
console.log(controller.settings.useAnalogAsDpad);
>> "left"
Notes:

1 If the setting you're updating is an array of key/value pairs, you can update a subset of them directly.

.analogStickDeadzones = {min: 0.2, max: 1};
.analogStickDeadzones.min = 0.2;
Clone this wiki locally