diff --git a/extensions/community/ElectricArcPainter.json b/extensions/community/ElectricArcPainter.json new file mode 100644 index 000000000..c92883c71 --- /dev/null +++ b/extensions/community/ElectricArcPainter.json @@ -0,0 +1,1139 @@ +{ + "author": "", + "category": "Visual effect", + "extensionNamespace": "", + "fullName": "Paint electric arc", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBkPSJNMjYuOSwxNS43QzI2LjgsMTUuMywyNi40LDE1LDI2LDE1aC02bDMuOS0xMS43YzAuMS0wLjQsMC0wLjktMC40LTEuMWMtMC40LTAuMy0wLjgtMC4yLTEuMiwwbC0xNywxMw0KCWMtMC4zLDAuMy0wLjUsMC43LTAuMywxLjFDNS4yLDE2LjcsNS42LDE3LDYsMTdoNkw4LjEsMjguN2MtMC4xLDAuNCwwLDAuOSwwLjQsMS4xQzguNiwyOS45LDguOCwzMCw5LDMwYzAuMiwwLDAuNC0wLjEsMC42LTAuMg0KCWwxNy0xM0MyNi45LDE2LjUsMjcuMSwxNi4xLDI2LjksMTUuN3oiLz4NCjwvc3ZnPg0K", + "name": "ElectricArcPainter", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Weather/411965b85984347fb5d15df9ef253f7379f1aa590d362eb5574c58d36d9ee9c0_Weather_lightning_bolt_weather_storm_energy_electricity.svg", + "shortDescription": "Allows to paint an electric arc with a shape painter.", + "version": "1.0.0", + "description": [ + "Noise extension is needed for this extension to work!", + "", + "This extension allows to draw electric arcs using noise generation on a shape painter for visual effects.", + "", + "You can do things like:", + "- A lightning trail for your characters.", + "- Flashy visual effects for impactful moments.", + "- Better looking environment hazards.", + "- Electrifying explosion effects." + ], + "tags": [], + "authorIds": [ + "SEnxPnvGuQhQmTXJ3xwZa1lQFdr1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [ + { + "description": "Draws an electric arc line using noise.", + "fullName": "Electric arc painter", + "name": "ElectricArcPainter", + "objectType": "PrimitiveDrawing::Drawer", + "eventsFunctions": [ + { + "description": "Paints an electric arc from a point to another.", + "fullName": "Electric arc", + "functionType": "Action", + "group": "Drawing", + "name": "PaintElectricArc", + "sentence": "Draw from _PARAM2_;_PARAM3_ to _PARAM4_;_PARAM5_ an electric arc (thickness: _PARAM9_) with _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "X", + "=", + "StartX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Y", + "=", + "StartY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "=", + "PointAmount" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "PointAmount", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "=", + "(DestinationX - StartX) / PointAmount" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "=", + "(DestinationY - StartY) / PointAmount" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "+", + "Variation * Noise::Noise2d(\"Lightning\", Count - Seed, Count + Seed)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "+", + "Variation * Noise::Noise2d(\"Lightning\", Count + Seed, Count - Seed)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Count", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "=", + "(DestinationX - X)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "=", + "(DestinationY - Y)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "Object", + "X", + "Y", + "X + DiffX", + "Y + DiffY", + "Thickness" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "Object", + "X", + "Y", + "Thickness / 2" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "Object", + "X + DiffX", + "Y + DiffY", + "Thickness / 2" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "X", + "=", + "X + DiffX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Y", + "=", + "Y + DiffY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "-", + "1" + ] + } + ] + } + ], + "variables": [ + { + "name": "DiffX", + "type": "number", + "value": 0 + }, + { + "name": "DiffY", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Count", + "type": "number", + "value": 0 + }, + { + "name": "X", + "type": "number", + "value": 0 + }, + { + "name": "Y", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PrimitiveDrawing::Drawer", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ElectricArcPainter::ElectricArcPainter", + "type": "behavior" + }, + { + "description": "X position of start point", + "name": "StartX", + "type": "expression" + }, + { + "description": "Y position of start point", + "name": "StartY", + "type": "expression" + }, + { + "description": "X position of end point", + "name": "DestinationX", + "type": "expression" + }, + { + "description": "Y position of end point", + "name": "DestinationY", + "type": "expression" + }, + { + "description": "Number of points", + "name": "PointAmount", + "type": "expression" + }, + { + "description": "Seed value", + "name": "Seed", + "type": "expression" + }, + { + "description": "Variability", + "name": "Variation", + "type": "expression" + }, + { + "description": "Thickness (in pixels)", + "name": "Thickness", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "Paints an electric arc from a point to another with a difference in thickness.", + "fullName": "Electric arc (Advanced)", + "functionType": "Action", + "group": "Drawing", + "name": "PaintElectricArcAdvanced", + "sentence": "Draw from _PARAM2_;_PARAM3_ to _PARAM4_;_PARAM5_ an electric arc (start thickness: _PARAM9_ end thickness: _PARAM10_) with _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "X", + "=", + "StartX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Y", + "=", + "StartY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "=", + "PointAmount" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ThicknessDiff", + "=", + "EndThickness - StartThickness" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "PointAmount", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "=", + "(DestinationX - StartX) / PointAmount" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "=", + "(DestinationY - StartY) / PointAmount" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "+", + "Variation * Noise::Noise2d(\"Lightning\", Count - Seed, Count + Seed)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "+", + "Variation * Noise::Noise2d(\"Lightning\", Count + Seed, Count - Seed)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Count", + "=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "=", + "(DestinationX - X)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "=", + "(DestinationY - Y)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "PrimitiveDrawing::LineV2" + }, + "parameters": [ + "Object", + "X", + "Y", + "X + DiffX", + "Y + DiffY", + "EndThickness - (ThicknessDiff * (Count/ PointAmount))" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "Object", + "X", + "Y", + "(EndThickness - (ThicknessDiff * ((Count + 0.5)/ PointAmount))) / 2" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "Object", + "X", + "Y", + "(EndThickness - (ThicknessDiff * (Count/ PointAmount))) / 2" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "Object", + "X + DiffX", + "Y + DiffY", + "(EndThickness - (ThicknessDiff * ((Count - 0.5)/ PointAmount))) / 2" + ] + }, + { + "type": { + "value": "PrimitiveDrawing::Circle" + }, + "parameters": [ + "Object", + "X + DiffX", + "Y + DiffY", + "(EndThickness - (ThicknessDiff * (Count/ PointAmount))) / 2" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "X", + "=", + "X + DiffX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Y", + "=", + "Y + DiffY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "-", + "1" + ] + } + ] + } + ], + "variables": [ + { + "name": "DiffX", + "type": "number", + "value": 0 + }, + { + "name": "DiffY", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Count", + "type": "number", + "value": 0 + }, + { + "name": "X", + "type": "number", + "value": 0 + }, + { + "name": "Y", + "type": "number", + "value": 0 + }, + { + "name": "ThicknessDiff", + "type": "number", + "value": 0 + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PrimitiveDrawing::Drawer", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ElectricArcPainter::ElectricArcPainter", + "type": "behavior" + }, + { + "description": "X position of start point", + "name": "StartX", + "type": "expression" + }, + { + "description": "Y position of start point", + "name": "StartY", + "type": "expression" + }, + { + "description": "X position of end point", + "name": "DestinationX", + "type": "expression" + }, + { + "description": "Y position of end point", + "name": "DestinationY", + "type": "expression" + }, + { + "description": "Number of points", + "name": "PointAmount", + "type": "expression" + }, + { + "description": "Seed value", + "name": "Seed", + "type": "expression" + }, + { + "description": "Variability", + "name": "Variation", + "type": "expression" + }, + { + "description": "Start thickness (in pixels)", + "name": "StartThickness", + "type": "expression" + }, + { + "description": "End thickness (in pixels)", + "name": "EndThickness", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the x position related to an electric arc draw pattern.", + "fullName": "Obtain X from reference", + "functionType": "ExpressionAndCondition", + "group": "Drawing", + "name": "ObtainX", + "sentence": "The x position related to an electric arc draw pattern", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "X", + "=", + "StartX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "=", + "PointAmount" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "PointAmount + 1", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "=", + "(DestinationX - StartX) / PointAmount" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffX", + "+", + "Variation * Noise::Noise2d(\"Lightning\", Count - Seed, Count + Seed)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Count", + "=", + "Point" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "X" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Count", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DestinationX" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "X", + "=", + "X + DiffX" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "-", + "1" + ] + } + ] + } + ], + "variables": [ + { + "name": "DiffX", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Count", + "type": "number", + "value": 0 + }, + { + "name": "X", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PrimitiveDrawing::Drawer", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ElectricArcPainter::ElectricArcPainter", + "type": "behavior" + }, + { + "description": "X position of start point", + "name": "StartX", + "type": "expression" + }, + { + "description": "Y position of start point", + "name": "StartY", + "type": "expression" + }, + { + "description": "X position of end point", + "name": "DestinationX", + "type": "expression" + }, + { + "description": "Y position of end point", + "name": "DestinationY", + "type": "expression" + }, + { + "description": "Number of points", + "name": "PointAmount", + "type": "expression" + }, + { + "description": "Seed value", + "name": "Seed", + "type": "expression" + }, + { + "description": "Variability", + "name": "Variation", + "type": "expression" + }, + { + "description": "Point reference", + "name": "Point", + "supplementaryInformation": "TextObject::Text", + "type": "expression" + } + ], + "objectGroups": [] + }, + { + "description": "the y position related to an electric arc draw pattern.", + "fullName": "Obtain Y from reference", + "functionType": "ExpressionAndCondition", + "group": "Drawing", + "name": "ObtainY", + "sentence": "The y position related to an electric arc draw pattern", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Y", + "=", + "StartY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "=", + "PointAmount" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "PointAmount + 1", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "=", + "(DestinationY - StartY) / PointAmount" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DiffY", + "+", + "Variation * Noise::Noise2d(\"Lightning\", Count + Seed, Count - Seed)" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Count", + "=", + "Point" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Y" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Count", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "DestinationY" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Y", + "=", + "Y + DiffY" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Count", + "-", + "1" + ] + } + ] + } + ], + "variables": [ + { + "name": "DiffY", + "type": "number", + "value": 0 + } + ] + } + ] + } + ], + "variables": [ + { + "name": "Count", + "type": "number", + "value": 0 + }, + { + "name": "Y", + "type": "number", + "value": 0 + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PrimitiveDrawing::Drawer", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ElectricArcPainter::ElectricArcPainter", + "type": "behavior" + }, + { + "description": "X position of start point", + "name": "StartX", + "type": "expression" + }, + { + "description": "Y position of start point", + "name": "StartY", + "type": "expression" + }, + { + "description": "X position of end point", + "name": "DestinationX", + "type": "expression" + }, + { + "description": "Y position of end point", + "name": "DestinationY", + "type": "expression" + }, + { + "description": "Number of points", + "name": "PointAmount", + "type": "expression" + }, + { + "description": "Seed value", + "name": "Seed", + "type": "expression" + }, + { + "description": "Variability", + "name": "Variation", + "type": "expression" + }, + { + "description": "Point reference", + "name": "Point", + "supplementaryInformation": "TextObject::Text", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "propertyDescriptors": [], + "sharedPropertyDescriptors": [] + } + ], + "eventsBasedObjects": [] +} \ No newline at end of file