From d6ffcb256fdf18a55e66b7ad6486e5cd3a5223f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 15:59:28 +0200 Subject: [PATCH 1/4] Make the DragCameraWithPointer extension experimental --- extensions/{reviewed => community}/DragCameraWithPointer.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename extensions/{reviewed => community}/DragCameraWithPointer.json (100%) diff --git a/extensions/reviewed/DragCameraWithPointer.json b/extensions/community/DragCameraWithPointer.json similarity index 100% rename from extensions/reviewed/DragCameraWithPointer.json rename to extensions/community/DragCameraWithPointer.json From c66a7b88e141d45f5b1534b04e9d6b6f62a20ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 16:10:03 +0200 Subject: [PATCH 2/4] Make the DragCameraWithPointer extension deprecated --- extensions/community/DragCameraWithPointer.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/community/DragCameraWithPointer.json b/extensions/community/DragCameraWithPointer.json index cc1bb4b3e..67553786f 100644 --- a/extensions/community/DragCameraWithPointer.json +++ b/extensions/community/DragCameraWithPointer.json @@ -8,12 +8,14 @@ "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRyYWctdmFyaWFudCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0yMi42NywxMkwxOC4xOCwxNi41TDE1LjY3LDE0TDE3LjY1LDEyTDE1LjY3LDEwLjA0TDE4LjE4LDcuNTNMMjIuNjcsMTJNMTIsMS4zM0wxNi40Nyw1LjgyTDEzLjk2LDguMzNMMTIsNi4zNUwxMCw4LjMzTDcuNSw1LjgyTDEyLDEuMzNNMTIsMjIuNjdMNy41MywxOC4xOEwxMC4wNCwxNS42N0wxMiwxNy42NUwxNCwxNS42N0wxNi41LDE4LjE4TDEyLDIyLjY3TTEuMzMsMTJMNS44Miw3LjVMOC4zMywxMEw2LjM1LDEyTDguMzMsMTMuOTZMNS44MiwxNi40N0wxLjMzLDEyTTEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyQTIsMiAwIDAsMSAxMiwxMFoiIC8+PC9zdmc+", "name": "DragCameraWithPointer", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/drag-variant.svg", - "shortDescription": "Pan/drag camera with mouse or touch. Configurable inertia and bounds.", + "shortDescription": "Pan/drag camera with mouse or touch.", "dimension": "2D", "version": "1.2.0", "description": [ "Move a camera by dragging the mouse (or touchscreen). ", - "", + "", + "This extension is deprecated. The [scrollable viewport extension](https://wiki.gdevelop.io/gdevelop5/extensions/scrollable-viewport) should be used instead.", + "", "How to use:", "- Run this action on every frame that you want the camera to be movable by the mouse (or touchscreen)", "- Select the mouse button to use (choose \"left\" for touchscreen)", From 1ab2d824ceaee4249744eb461e5db864fe8e7039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 16:17:28 +0200 Subject: [PATCH 3/4] Add the new extension --- extensions/reviewed/ScrollableViewport.json | 1543 +++++++++++++++++++ 1 file changed, 1543 insertions(+) create mode 100644 extensions/reviewed/ScrollableViewport.json diff --git a/extensions/reviewed/ScrollableViewport.json b/extensions/reviewed/ScrollableViewport.json new file mode 100644 index 000000000..ef730f9c7 --- /dev/null +++ b/extensions/reviewed/ScrollableViewport.json @@ -0,0 +1,1543 @@ +{ + "author": "@ddabrahim", + "category": "Camera", + "dimension": "2D", + "extensionNamespace": "", + "fullName": "Scrollable viewport", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRyYWctdmFyaWFudCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0yMi42NywxMkwxOC4xOCwxNi41TDE1LjY3LDE0TDE3LjY1LDEyTDE1LjY3LDEwLjA0TDE4LjE4LDcuNTNMMjIuNjcsMTJNMTIsMS4zM0wxNi40Nyw1LjgyTDEzLjk2LDguMzNMMTIsNi4zNUwxMCw4LjMzTDcuNSw1LjgyTDEyLDEuMzNNMTIsMjIuNjdMNy41MywxOC4xOEwxMC4wNCwxNS42N0wxMiwxNy42NUwxNCwxNS42N0wxNi41LDE4LjE4TDEyLDIyLjY3TTEuMzMsMTJMNS44Miw3LjVMOC4zMywxMEw2LjM1LDEyTDguMzMsMTMuOTZMNS44MiwxNi40N0wxLjMzLDEyTTEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyQTIsMiAwIDAsMSAxMiwxMFoiIC8+PC9zdmc+", + "name": "ScrollableViewport", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/drag-variant.svg", + "shortDescription": "Move a camera by dragging or with the scroll wheel.", + "version": "1.0.0", + "description": [ + "Move a camera by dragging or with the scroll wheel.", + "", + "It can be used for", + "- Making a scroll view ([open the project online](https://editor.gdevelop.io/?project=example://scrollbar))", + "- Dragging the camera on a top-down game" + ], + "tags": [ + "mouse", + "cursor", + "pointer", + "touch", + "drag", + "camera", + "scroll", + "gestures" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "GfzRsieyUFVnsRR8OZThsPR29oq2", + "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [ + { + "name": "ScrollStartX", + "type": "number", + "value": 0 + }, + { + "name": "ScrollStartY", + "type": "number", + "value": 0 + }, + { + "name": "IsCameraDragged", + "type": "boolean", + "value": false + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Expression", + "name": "MoveToZero", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Value", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "max(0, Value - Step)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Value", + "<", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "min(0, Value + Step)" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Value", + "name": "Value", + "type": "expression" + }, + { + "description": "Step", + "name": "Step", + "type": "expression" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "MoveToZero" + } + ] + }, + "eventsBasedBehaviors": [ + { + "description": "Move a camera by dragging or with the scroll wheel.", + "fullName": "Scrollable viewport", + "helpPath": "", + "iconUrl": "", + "name": "ScrollableViewport", + "objectType": "", + "previewIconUrl": "", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "OldCameraX", + "!=", + "CameraCenterX(Layer)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "0" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "OldCameraY", + "!=", + "CameraCenterY(Layer)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "0" + ] + } + ] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Dragging", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "MouseButtonFromTextPressed" + }, + "parameters": [ + "", + "\"Left\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + }, + { + "type": { + "value": "IsCursorOnObject" + }, + "parameters": [ + "Object", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Dragged\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Dragged\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "0" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "0" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartX", + "=", + "CursorX(Layer)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "StartY", + "=", + "CursorY(Layer)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "!=", + "\"Vertical\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "(CursorX(Layer) - StartX) / TimeDelta()" + ] + }, + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "-", + "CursorX(Layer) - StartX", + "Layer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "!=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "(CursorY(Layer) - StartY) / TimeDelta()" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "CursorY(Layer) - StartY", + "Layer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "MouseButtonFromTextPressed" + }, + "parameters": [ + "", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Inertia\"" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Inertia\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "-", + "SpeedX * TimeDelta()", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "ScrollableViewport::MoveToZero(SpeedX, InertiaDeceleration * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "SpeedY * TimeDelta()", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "ScrollableViewport::MoveToZero(SpeedY, InertiaDeceleration * TimeDelta())" + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Wheel", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "WheelStepSize", + "!=", + "0" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsMouseWheelScrollingUp" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "IsCursorOnObject" + }, + "parameters": [ + "Object", + "", + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "!=", + "\"Wheeled\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Wheeled\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraX", + "=", + "CameraCenterX(Layer)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraY", + "=", + "CameraCenterY(Layer)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraX" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "WheelStepSize", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraY" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "WheelStepSize", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsMouseWheelScrollingDown" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "IsCursorOnObject" + }, + "parameters": [ + "Object", + "", + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "!=", + "\"Wheeled\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Wheeled\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraX", + "=", + "CameraCenterX(Layer)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraY", + "=", + "CameraCenterY(Layer)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "WheelStepSize", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraY" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "WheelStepSize", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Wheeled\"" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "+", + "SpeedX * TimeDelta()", + "Layer", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sign(SpeedX)", + "=", + "sign(CameraCenterX(Layer) - TargetedCameraX)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "=", + "TargetedCameraX", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "0" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedY", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "+", + "SpeedY * TimeDelta()", + "Layer", + "" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sign(SpeedY)", + "=", + "sign(CameraCenterY(Layer) - TargetedCameraY)" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "=", + "TargetedCameraY", + "Layer", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "0" + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "parameters": [] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "!=", + "\"Dragged\"" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "0" + ] + }, + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Idle\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldCameraX", + "=", + "CameraCenterX(Layer)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldCameraY", + "=", + "CameraCenterY(Layer)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Check if camera is being dragged from this object.", + "fullName": "Camera is being dragged", + "functionType": "Condition", + "name": "IsDragged", + "sentence": "Camera is being dragged from _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "State", + "=", + "\"Dragged\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the targetedCameraY of the object.", + "fullName": "TargetedCameraY", + "functionType": "ExpressionAndCondition", + "name": "TargetedCameraY", + "private": true, + "sentence": "the targetedCameraY", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TargetedCameraY" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TargetedCameraY", + "name": "SetTargetedCameraY", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraY", + "=", + "Value" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "(TargetedCameraY - CameraCenterY(Layer)) / WheelScrollingDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the targetedCameraX of the object.", + "fullName": "TargetedCameraX", + "functionType": "ExpressionAndCondition", + "name": "TargetedCameraX", + "private": true, + "sentence": "the targetedCameraX", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "TargetedCameraX" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TargetedCameraX", + "name": "SetTargetedCameraX", + "private": true, + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraX", + "=", + "Value" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "(TargetedCameraX - CameraCenterX(Layer)) / WheelScrollingDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDeActivate", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Idle\"" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPreEvents" + }, + { + "functionName": "IsDragged" + }, + { + "functionName": "TargetedCameraY" + }, + { + "functionName": "SetTargetedCameraY" + }, + { + "functionName": "TargetedCameraX" + }, + { + "functionName": "SetTargetedCameraX" + }, + { + "functionName": "onDeActivate" + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Choice", + "label": "Direction", + "choices": [ + { + "label": "Vertical", + "value": "Vertical" + }, + { + "label": "Horizontal", + "value": "Horizontal" + }, + { + "label": "Both", + "value": "Both" + } + ], + "name": "Direction" + }, + { + "value": "", + "type": "Boolean", + "label": "Camera is being dragged", + "group": "Dragging", + "hidden": true, + "name": "IsDragged" + }, + { + "value": "", + "type": "Number", + "label": "", + "group": "Dragging", + "hidden": true, + "name": "StartX" + }, + { + "value": "", + "type": "Number", + "label": "", + "group": "Dragging", + "hidden": true, + "name": "StartY" + }, + { + "value": "", + "type": "String", + "label": "Dragged layer", + "description": "The dragged layer must be different from this object layer.", + "name": "Layer" + }, + { + "value": "", + "type": "Number", + "label": "", + "group": "Wheel", + "hidden": true, + "name": "TargetedCameraX" + }, + { + "value": "", + "type": "Number", + "label": "", + "group": "Wheel", + "hidden": true, + "name": "TargetedCameraY" + }, + { + "value": "0.25", + "type": "Number", + "unit": "Second", + "label": "Wheel scrolling duration", + "group": "Wheel", + "name": "WheelScrollingDuration" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "OldCameraX" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "OldCameraY" + }, + { + "value": "120", + "type": "Number", + "unit": "Pixel", + "label": "Step size", + "group": "Wheel", + "name": "WheelStepSize" + }, + { + "value": "Idle", + "type": "String", + "label": "", + "hidden": true, + "name": "State" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "SpeedX" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "SpeedY" + }, + { + "value": "800", + "type": "Number", + "unit": "PixelAcceleration", + "label": "", + "group": "Dragging", + "name": "InertiaDeceleration" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "State" + }, + { + "propertyName": "Layer" + }, + { + "propertyName": "Direction" + }, + { + "propertyName": "OldCameraX" + }, + { + "propertyName": "OldCameraY" + }, + { + "propertyName": "SpeedX" + }, + { + "propertyName": "SpeedY" + }, + { + "folderName": "Dragging", + "children": [ + { + "propertyName": "InertiaDeceleration" + }, + { + "propertyName": "IsDragged" + }, + { + "propertyName": "StartX" + }, + { + "propertyName": "StartY" + } + ] + }, + { + "folderName": "Wheel", + "children": [ + { + "propertyName": "WheelStepSize" + }, + { + "propertyName": "WheelScrollingDuration" + }, + { + "propertyName": "TargetedCameraX" + }, + { + "propertyName": "TargetedCameraY" + } + ] + } + ] + } + } + ], + "eventsBasedObjects": [] +} From 8038456af0fbe76b6ce914d64a372d254e0576b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 16:21:56 +0200 Subject: [PATCH 4/4] Remove unused variables --- extensions/reviewed/ScrollableViewport.json | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/extensions/reviewed/ScrollableViewport.json b/extensions/reviewed/ScrollableViewport.json index ef730f9c7..2ebf77c1f 100644 --- a/extensions/reviewed/ScrollableViewport.json +++ b/extensions/reviewed/ScrollableViewport.json @@ -35,23 +35,7 @@ ], "dependencies": [], "globalVariables": [], - "sceneVariables": [ - { - "name": "ScrollStartX", - "type": "number", - "value": 0 - }, - { - "name": "ScrollStartY", - "type": "number", - "value": 0 - }, - { - "name": "IsCameraDragged", - "type": "boolean", - "value": false - } - ], + "sceneVariables": [], "eventsFunctions": [ { "fullName": "",