MCPcopy
hub / github.com/4ian/GDevelop / setValue

Method setValue

GDJS/Runtime/variable.ts:661–665  ·  view source on GitHub ↗

* Sets the primitive value using the setter of the current type. * @param newValue The primitive value of the variable.

(newValue: string | float | boolean)

Source from the content-addressed store, hash-verified

659 * @param newValue The primitive value of the variable.
660 */
661 setValue(newValue: string | float | boolean) {
662 if (this._type === 'string') this.setString(newValue as string);
663 else if (this._type === 'number') this.setNumber(newValue as float);
664 else if (this._type === 'boolean') this.setBoolean(newValue as boolean);
665 }
666
667 /**
668 * Gets the primitive value using the getter of the current type.

Callers 15

JsExtension.jsFile · 0.45
JsExtension.jsFile · 0.45
JsExtension.jsFile · 0.45
JsExtension.jsFile · 0.45
_updateValueMethod · 0.45
_updateValueMethod · 0.45
tintMethod · 0.45
darkTintMethod · 0.45
updateMethod · 0.45
JsExtension.jsFile · 0.45
JsExtension.jsFile · 0.45

Calls 3

setStringMethod · 0.95
setNumberMethod · 0.95
setBooleanMethod · 0.95

Tested by 2

createEventBasedObjectFunction · 0.36