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

Function tweenSetterFactory

Extensions/TweenBehavior/tweenruntimebehavior.ts:257–371  ·  view source on GitHub ↗
(object: RuntimeObject)

Source from the content-addressed store, hash-verified

255
256 const tweenSetterFactory =
257 (object: RuntimeObject) =>
258 (tweenInformation: TweenInformationNetworkSyncData) => {
259 const type = tweenInformation.type;
260 const variablePath = tweenInformation.variablePath;
261 const effectName = tweenInformation.effectName;
262 const propertyName = tweenInformation.propertyName;
263 const scaleFromCenterOfObject =
264 !!tweenInformation.scaleFromCenterOfObject;
265 const useHSLColorTransition = !!tweenInformation.useHSLColorTransition;
266 if (type === 'objectValue') {
267 return tweenObjectValueSetter;
268 }
269 if (type === 'variable' && variablePath) {
270 const variable = object
271 .getVariables()
272 .getVariableFromPath(variablePath);
273 if (!variable) return () => {};
274 return getTweenVariableSetter(variable);
275 }
276 if (type === 'positionX') {
277 return getTweenObjectPositionXSetter(object);
278 }
279 if (type === 'positionY') {
280 return getTweenObjectPositionYSetter(object);
281 }
282 if (type === 'position') {
283 return getTweenObjectPositionSetter(object);
284 }
285 if (type === 'positionZ') {
286 return getTweenObjectPositionZSetter(object);
287 }
288 if (type === 'width') {
289 return getTweenObjectWidthSetter(object);
290 }
291 if (type === 'height') {
292 return getTweenObjectHeightSetter(object);
293 }
294 if (type === 'depth') {
295 if (!is3D(object)) return () => {};
296 return getTweenObjectDepthSetter(object);
297 }
298 if (type === 'angle') {
299 return getTweenObjectAngleSetter(object);
300 }
301 if (type === 'rotationX') {
302 if (!is3D(object)) return () => {};
303 return getTweenObjectRotationXSetter(object);
304 }
305 if (type === 'rotationY') {
306 if (!is3D(object)) return () => {};
307 return getTweenObjectRotationYSetter(object);
308 }
309 if (type === 'scale') {
310 if (!isScalable(object)) return () => {};
311
312 const object3d = is3D(object) ? object : null;
313 return getTweenObjectScaleSetter(
314 object,

Callers 1

Tested by

no test coverage detected