-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated Extension submission for issue #1520
- Loading branch information
Showing
1 changed file
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"author": "", | ||
"category": "User interface", | ||
"extensionNamespace": "", | ||
"fullName": "OscilloWave", | ||
"helpPath": "", | ||
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXRpbGRlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIsMTVDMiwxNSAyLDkgOCw5QzEyLDkgMTIuNSwxMi41IDE1LjUsMTIuNUMxOS41LDEyLjUgMTkuNSw5IDE5LjUsOUgyMkMyMiw5IDIyLDE1IDE2LDE1QzEyLDE1IDEwLjUsMTEuNSA4LjUsMTEuNUM0LjUsMTEuNSA0LjUsMTUgNC41LDE1SDIiIC8+PC9zdmc+", | ||
"name": "OscilloWave", | ||
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/261f5ee19b69f65a27fcdb4b0d3ec64029f928fe8713db1bb180bb69d72fc4a7_tilde.svg", | ||
"shortDescription": "OscilloWave is a simple extension that adds smooth, sinusoidal wave motion or shock to any object, perfect for creating dynamic UI elements and eye-catching animations. Ideal for making title images float and move seamlessly in menu screens.", | ||
"version": "1.0.0", | ||
"description": [ | ||
"**OscilloWave** is a user-friendly extension that enhances your user interface by smoothly oscillating selected objects in a wave motion, similar to a sine function. This effect is perfect for animating game titles, giving them a dynamic \"floating\" effect as they move up and down ideal for creating a more engaging menu screen. However, it can also be applied to any other scene elements to create visually appealing, rhythmic motion throughout your game.", | ||
"" | ||
], | ||
"tags": [ | ||
"animation", | ||
"wave", | ||
"UI", | ||
"motion", | ||
"interactive", | ||
"banner", | ||
"text", | ||
"background", | ||
"effects", | ||
"smooth", | ||
"shock" | ||
], | ||
"authorIds": [ | ||
"MVyDtd59ONXYYSVjuI3Z1AgWt8g1" | ||
], | ||
"dependencies": [], | ||
"globalVariables": [], | ||
"sceneVariables": [], | ||
"eventsFunctions": [ | ||
{ | ||
"description": "Apply a smooth wave motion to the selected object.", | ||
"fullName": "Apply a smooth wave motion to the object", | ||
"functionType": "Action", | ||
"group": "Oscilate", | ||
"name": "Function", | ||
"sentence": "Apply wave motion to _PARAM1_ continuously, with an amplitude of _PARAM2_, a frequency of _PARAM3_, and a speed of _PARAM4_,the motion lasts for _PARAM5_, with a phase offset of _PARAM6_, movement applied on _PARAM7_ axis , and a modulation strenght of _PARAM8_", | ||
"events": [ | ||
{ | ||
"type": "BuiltinCommonInstructions::JsCode", | ||
"inlineCode": [ | ||
"// Retrieve parameters\r", | ||
"const amplitude = eventsFunctionContext.getArgument(\"Amplitude\");\r", | ||
"const frequency = eventsFunctionContext.getArgument(\"Frequency\");\r", | ||
"const speed = eventsFunctionContext.getArgument(\"Speed\");\r", | ||
"const elapsedTime = eventsFunctionContext.getArgument(\"Time\"); // Passed from the event\r", | ||
"const phaseOffset = eventsFunctionContext.getArgument(\"PhaseOffset\");\r", | ||
"const axis = eventsFunctionContext.getArgument(\"Axis\"); // \"X\", \"Y\", or \"Both\"\r", | ||
"const modulationStrength = eventsFunctionContext.getArgument(\"ModulationStrength\"); // Controls easing strength\r", | ||
"\r", | ||
"// Get objects\r", | ||
"const objectsToAnimate = eventsFunctionContext.getObjects(\"Oscilate\");\r", | ||
"\r", | ||
"for (let index = 0; index < objectsToAnimate.length; index++) {\r", | ||
" const object = objectsToAnimate[index];\r", | ||
"\r", | ||
" if (object) {\r", | ||
" // Initialize original positions once\r", | ||
" if (typeof object.initialY === \"undefined\") {\r", | ||
" object.initialY = object.getY();\r", | ||
" }\r", | ||
" if (typeof object.initialX === \"undefined\") {\r", | ||
" object.initialX = object.getX();\r", | ||
" }\r", | ||
"\r", | ||
" // Calculate unique phase offset per object\r", | ||
" const x = object.getX();\r", | ||
" const objectPhase = phaseOffset * index; // Each object has a unique shift\r", | ||
" const easedWave = Math.sin(frequency * x + elapsedTime * speed + objectPhase) \r", | ||
" * (1 - Math.cos(elapsedTime * 2 * modulationStrength)) / 2;\r", | ||
" const offset = amplitude * easedWave;\r", | ||
"\r", | ||
" // Apply movement based on selected axis\r", | ||
" if (axis === \"Y\" || axis === \"Both\") {\r", | ||
" object.setY(object.initialY + offset);\r", | ||
" }\r", | ||
" if (axis === \"X\" || axis === \"Both\") {\r", | ||
" object.setX(object.initialX + offset);\r", | ||
" }\r", | ||
" }\r", | ||
"}\r", | ||
"" | ||
], | ||
"parameterObjects": "Oscilate", | ||
"useStrict": true, | ||
"eventsSheetExpanded": true | ||
} | ||
], | ||
"parameters": [ | ||
{ | ||
"description": "Object", | ||
"name": "Oscilate", | ||
"type": "objectList" | ||
}, | ||
{ | ||
"description": "Height of the wave", | ||
"name": "Amplitude", | ||
"type": "expression" | ||
}, | ||
{ | ||
"description": "Frequency of the wave", | ||
"name": "Frequency", | ||
"type": "expression" | ||
}, | ||
{ | ||
"description": "Speed of the wave movement", | ||
"name": "Speed", | ||
"type": "expression" | ||
}, | ||
{ | ||
"description": "TimeFromStart()", | ||
"name": "Time", | ||
"type": "expression" | ||
}, | ||
{ | ||
"description": "How much each wave is offset", | ||
"name": "PhaseOffset", | ||
"type": "expression" | ||
}, | ||
{ | ||
"description": "Choose \"X\", \"Y\", or \"Both\"", | ||
"name": "Axis", | ||
"supplementaryInformation": "[\"Y\",\"X\",\"Both\"]", | ||
"type": "stringWithSelector" | ||
}, | ||
{ | ||
"description": "Controls how strong the easing effect is", | ||
"name": "ModulationStrength", | ||
"type": "expression" | ||
} | ||
], | ||
"objectGroups": [] | ||
} | ||
], | ||
"eventsBasedBehaviors": [], | ||
"eventsBasedObjects": [] | ||
} |