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

Method setNumber

GDJS/Runtime/variable.ts:579–584  ·  view source on GitHub ↗

* Change the value of the variable, considered as a number * @param newValue The new value to be set

(newValue: float)

Source from the content-addressed store, hash-verified

577 * @param newValue The new value to be set
578 */
579 setNumber(newValue: float) {
580 this._type = 'number';
581 //@ts-ignore parseFloat does accept numbers.
582 newValue = parseFloat(newValue);
583 this._value = newValue === newValue ? newValue : 0; // Prevent NaN
584 }
585
586 /**
587 * Get the value of the variable, considered as a string

Callers 15

fromJSObjectMethod · 0.95
castToMethod · 0.95
setValueMethod · 0.95
addMethod · 0.95
subMethod · 0.95
mulMethod · 0.95
divMethod · 0.95
getPlayerEntryFunction · 0.45
serializeToVariableFunction · 0.45
getTweenVariableSetterFunction · 0.45
getTweenVariableSetterFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected