From 709240f37cfeebf1ea40058b705b4374808afcab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Wed, 6 May 2026 16:51:15 +0200 Subject: [PATCH 01/12] Add a scrollable text object --- examples/scrollbar/scrollbar.json | 1058 ++++++++++++++++++++++++++++- 1 file changed, 1048 insertions(+), 10 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index e1cd82559..522b640e2 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -214,7 +214,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": false, - "zoomFactor": 0.713037763069044, + "zoomFactor": 0.5843784410740964, "windowMask": false, "selectedLayer": "", "gameEditorMode": "instances-editor" @@ -366,6 +366,22 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] + }, + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "NewScrollableText", + "persistentUuid": "73913249-039a-458c-849e-a41b1e24972e", + "width": 0, + "x": 782, + "y": 265, + "zOrder": 14, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] } ], "objects": [ @@ -654,6 +670,17 @@ ] } ] + }, + { + "assetStoreId": "", + "name": "NewScrollableText", + "persistentUuid": "a325f0bc-13bc-451a-b5bf-4dafe29ce287", + "type": "ScrollableText::ScrollableText", + "variant": "", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} } ], "objectsFolderStructure": { @@ -668,6 +695,9 @@ { "objectName": "ContentBackground" }, + { + "objectName": "NewScrollableText" + }, { "objectName": "NoButton" }, @@ -1058,6 +1088,177 @@ "type": "TextContainerCapability::TextContainerBehavior" } ] + }, + { + "b": 24, + "disableInputWhenNotFocused": true, + "mangledName": "Untitled_32scene", + "name": "Untitled scene", + "r": 24, + "standardSortMethod": true, + "stopSoundsOnStartup": true, + "title": "", + "v": 24, + "uiSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 0.546875, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + }, + "objectsGroups": [], + "variables": [], + "instances": [ + { + "angle": 0, + "customSize": false, + "height": 0, + "keepRatio": true, + "layer": "", + "name": "YesButton", + "persistentUuid": "c2c60cda-c264-4dee-8215-48fec50b0a05", + "width": 0, + "x": 540, + "y": 292, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "objects": [ + { + "assetStoreId": "615de0316452630b9f4f6a39decc82e2449b82c1afd1ff24d6470dad2922177b", + "name": "YesButton", + "persistentUuid": "231a774d-826d-4dd5-85d6-b5d4b8ca1d81", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Small Yellow Button", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "LeftPadding": 16, + "RightPadding": 16, + "PressedLabelOffsetY": 2, + "BottomPadding": 32, + "TopPadding": 16, + "HoveredFadeOutDuration": 0.25, + "LabelText": "Yes" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "YesButton" + } + ] + }, + "events": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Ambient Hemisphere Light", + "doubleParameters": { + "elevation": 40, + "intensity": 0.33, + "rotation": 300 + }, + "stringParameters": { + "groundColor": "127;127;127", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::DirectionalLight", + "name": "3D Sun Light", + "doubleParameters": { + "distanceFromCamera": 1500, + "elevation": 40, + "frustumSize": 4000, + "intensity": 0.75, + "minimumShadowBias": 0, + "rotation": 300 + }, + "stringParameters": { + "color": "255;255;255", + "shadowQuality": "medium", + "top": "Z+" + }, + "booleanParameters": { + "isCastingShadow": true + } + } + ] + } + ], + "behaviorsSharedData": [ + { + "name": "Animation", + "type": "AnimatableCapability::AnimatableBehavior" + }, + { + "name": "Effect", + "type": "EffectCapability::EffectBehavior" + }, + { + "name": "Flippable", + "type": "FlippableCapability::FlippableBehavior" + }, + { + "name": "Opacity", + "type": "OpacityCapability::OpacityBehavior" + }, + { + "name": "Resizable", + "type": "ResizableCapability::ResizableBehavior" + }, + { + "name": "Scale", + "type": "ScalableCapability::ScalableBehavior" + } + ] } ], "externalEvents": [], @@ -2349,6 +2550,11 @@ "name": "ScrollStartY", "type": "number", "value": 0 + }, + { + "name": "IsCameraDragged", + "type": "boolean", + "value": false } ], "eventsFunctions": [ @@ -2359,6 +2565,22 @@ "name": "DragCameraWithPointer", "sentence": "Drag camera on layer _PARAM2_ in _PARAM3_ directions using _PARAM4_ mouse button", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCameraDragged", + "False", + "" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -2385,20 +2607,21 @@ "subInstructions": [ { "type": { - "value": "MouseButtonPressed" + "value": "StringVariable" }, "parameters": [ - "", - "Left" + "InputButton", + "=", + "\"\"" ] }, { "type": { - "inverted": true, - "value": "GetArgumentAsBoolean" + "value": "MouseButtonFromTextPressed" }, "parameters": [ - "\"InputButton\"" + "", + "\"Left\"" ] } ] @@ -2406,7 +2629,18 @@ ] } ], - "actions": [], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCameraDragged", + "True", + "" + ] + } + ], "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -2446,7 +2680,7 @@ "conditions": [ { "type": { - "value": "StrEqual" + "value": "StringVariable" }, "parameters": [ "Direction", @@ -2475,7 +2709,7 @@ "conditions": [ { "type": { - "value": "StrEqual" + "value": "StringVariable" }, "parameters": [ "Direction", @@ -2526,6 +2760,41 @@ } ], "objectGroups": [] + }, + { + "fullName": "Camera is dragged", + "functionType": "Condition", + "name": "IsCameraDragged", + "sentence": "Layer camera is dragged", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsCameraDragged", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [], + "objectGroups": [] } ], "eventsFunctionsFolderStructure": { @@ -2533,6 +2802,9 @@ "children": [ { "functionName": "DragCameraWithPointer" + }, + { + "functionName": "IsCameraDragged" } ] }, @@ -7349,6 +7621,772 @@ }, "eventsBasedBehaviors": [], "eventsBasedObjects": [] + }, + { + "author": "", + "category": "", + "dimension": "", + "extensionNamespace": "", + "fullName": "", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "", + "name": "ScrollableText", + "previewIconUrl": "", + "shortDescription": "", + "version": "", + "description": "", + "tags": [], + "authorIds": [], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT" + }, + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 440, + "areaMaxY": 337, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "defaultName": "", + "description": "", + "fullName": "", + "helpPath": "", + "iconUrl": "", + "isUsingLegacyInstancesRenderer": false, + "name": "ScrollableText", + "previewIconUrl": "", + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "NewSprite", + "persistentUuid": "5ad40ccf-893b-4420-a0c9-ce5a82afa7ca", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "ContentBackground", + "persistentUuid": "6f5d1b3d-7377-46e3-bac6-f77a71da6da2", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "DarkGrey", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "LightGrey", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 64, + "y": 0 + }, + { + "x": 64, + "y": 64 + }, + { + "x": 0, + "y": 64 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Text", + "persistentUuid": "eb367917-799f-4de5-8af3-ea8368a9d9a1", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\n\nUt velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\nAliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.", + "font": "", + "textAlignment": "left", + "characterSize": 18, + "color": { + "b": 29, + "g": 29, + "r": 29 + }, + "content": { + "bold": false, + "isOutlineEnabled": false, + "isShadowEnabled": false, + "italic": false, + "outlineColor": "255;255;255", + "outlineThickness": 2, + "shadowAngle": 90, + "shadowBlurRadius": 2, + "shadowColor": "0;0;0", + "shadowDistance": 4, + "shadowOpacity": 127, + "smoothed": true, + "underlined": false, + "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\n\nUt velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\nAliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.", + "font": "", + "textAlignment": "left", + "verticalTextAlignment": "top", + "characterSize": 18, + "lineHeight": 0, + "color": "29;29;29" + } + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Mask", + "persistentUuid": "3f200499-d561-41f6-8b4c-e3408196fa81", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [ + { + "name": "White", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "metadata": "{\"pskl\":{}}", + "timeBetweenFrames": 0.08, + "sprites": [ + { + "hasCustomCollisionMask": true, + "image": "White", + "points": [], + "originPoint": { + "name": "origine", + "x": 0, + "y": 0 + }, + "centerPoint": { + "automatic": true, + "name": "centre", + "x": 0, + "y": 0 + }, + "customCollisionMask": [ + [ + { + "x": 0, + "y": 0 + }, + { + "x": 64, + "y": 0 + }, + { + "x": 64, + "y": 64 + }, + { + "x": 0, + "y": 64 + } + ] + ] + } + ] + } + ] + } + ] + }, + { + "assetStoreId": "3b67abad485f3a4dee6271e8cdc41aee5e3f9da58939aeae39ad9dbd67e7140b", + "name": "ScrollBar", + "persistentUuid": "08ab7079-c9a0-4043-a084-785b97413bce", + "type": "Scrollbar::Scrollbar", + "variant": "Yellow rounded scroll bar", + "variables": [], + "effects": [], + "behaviors": [], + "content": {} + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "NewSprite" + }, + { + "objectName": "Text" + }, + { + "objectName": "ContentBackground" + }, + { + "objectName": "ScrollBar" + }, + { + "objectName": "Mask" + } + ] + }, + "objectsGroups": [ + { + "name": "Content", + "objects": [ + { + "name": "Text" + }, + { + "name": "ContentBackground" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "UI", + "renderingType": "", + "visibility": true, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Ambient Hemisphere Light", + "doubleParameters": { + "elevation": 40, + "intensity": 0.33, + "rotation": 300 + }, + "stringParameters": { + "groundColor": "127;127;127", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::DirectionalLight", + "name": "3D Sun Light", + "doubleParameters": { + "distanceFromCamera": 1500, + "elevation": 40, + "frustumSize": 4000, + "intensity": 0.75, + "minimumShadowBias": 0, + "rotation": 300 + }, + "stringParameters": { + "color": "255;255;255", + "shadowQuality": "medium", + "top": "Z+" + }, + "booleanParameters": { + "isCastingShadow": true + } + } + ] + }, + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "Mask", + "renderingType": "", + "visibility": false, + "cameras": [], + "effects": [ + { + "effectType": "Scene3D::HemisphereLight", + "name": "3D Ambient Hemisphere Light", + "doubleParameters": { + "elevation": 40, + "intensity": 0.33, + "rotation": 300 + }, + "stringParameters": { + "groundColor": "127;127;127", + "skyColor": "255;255;255", + "top": "Z+" + }, + "booleanParameters": {} + }, + { + "effectType": "Scene3D::DirectionalLight", + "name": "3D Sun Light", + "doubleParameters": { + "distanceFromCamera": 1500, + "elevation": 40, + "frustumSize": 4000, + "intensity": 0.75, + "minimumShadowBias": 0, + "rotation": 300 + }, + "stringParameters": { + "color": "255;255;255", + "shadowQuality": "medium", + "top": "Z+" + }, + "booleanParameters": { + "isCastingShadow": true + } + } + ] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 64, + "height": 337, + "keepRatio": true, + "layer": "UI", + "name": "ScrollBar", + "persistentUuid": "10e8cd1d-db62-4922-a779-5c0e5fb0ab3c", + "width": 24, + "x": 416, + "y": 0, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 337, + "keepRatio": true, + "layer": "Mask", + "name": "Mask", + "persistentUuid": "6f2ea7a4-9811-49cd-9c1c-da0c30e6e71b", + "width": 440, + "x": 0, + "y": 0, + "zOrder": 0, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 1093, + "keepRatio": true, + "layer": "", + "name": "Text", + "persistentUuid": "9390cb66-ff7c-4880-a43f-970dc70f736b", + "width": 353, + "x": 34, + "y": 32, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 1156, + "keepRatio": true, + "layer": "", + "name": "ContentBackground", + "persistentUuid": "866bf29b-8a83-4b1b-988d-fc09559295d8", + "width": 440, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.3993569068236673, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + }, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "MouseButtonFromTextPressed" + }, + "parameters": [ + "", + "\"Left\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + }, + { + "type": { + "value": "IsCursorOnObject" + }, + "parameters": [ + "Mask", + "", + "", + "" + ] + } + ] + }, + { + "type": { + "value": "DragCameraWithPointer::IsCameraDragged" + }, + "parameters": [ + "", + "" + ] + } + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Scrollbar::Scrollbar::IsThumbDragged" + }, + "parameters": [ + "ScrollBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DragCameraWithPointer" + }, + "parameters": [ + "", + "0", + "", + "\"vertical\"", + "Left", + "" + ] + }, + { + "type": { + "value": "Scrollbar::SetPositionFromCamera" + }, + "parameters": [ + "", + "ScrollBar", + "", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsMouseWheelScrollingUp" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "ScrollBar", + "-", + "100", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsMouseWheelScrollingDown" + }, + "parameters": [ + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "ScrollBar", + "+", + "100", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::SetCameraFromPosition" + }, + "parameters": [ + "", + "ScrollBar", + "\"\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetContentLength" + }, + "parameters": [ + "ScrollBar", + "=", + "ContentBackground.Height()", + "" + ] + }, + { + "type": { + "value": "ShowLayer" + }, + "parameters": [ + "", + "\"Mask\"" + ] + }, + { + "type": { + "value": "SpriteMasking::Mask" + }, + "parameters": [ + "", + "Content", + "Mask", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "onCreated" + }, + { + "functionName": "doStepPostEvents" + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "IsDragging" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "IsDragging" + } + ] + }, + "variants": [] + } + ] } ], "externalLayouts": [] From fe6f531edad211c176ca0325e6c951f484b718a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Wed, 6 May 2026 19:12:05 +0200 Subject: [PATCH 02/12] Add a behavior for scrolling --- examples/scrollbar/scrollbar.json | 2153 ++++++++++++++++++++++------- 1 file changed, 1685 insertions(+), 468 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 522b640e2..27195d09f 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -1088,177 +1088,6 @@ "type": "TextContainerCapability::TextContainerBehavior" } ] - }, - { - "b": 24, - "disableInputWhenNotFocused": true, - "mangledName": "Untitled_32scene", - "name": "Untitled scene", - "r": 24, - "standardSortMethod": true, - "stopSoundsOnStartup": true, - "title": "", - "v": 24, - "uiSettings": { - "grid": false, - "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, - "gridDepth": 32, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridOffsetZ": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 0.546875, - "windowMask": false, - "selectedLayer": "", - "gameEditorMode": "instances-editor" - }, - "objectsGroups": [], - "variables": [], - "instances": [ - { - "angle": 0, - "customSize": false, - "height": 0, - "keepRatio": true, - "layer": "", - "name": "YesButton", - "persistentUuid": "c2c60cda-c264-4dee-8215-48fec50b0a05", - "width": 0, - "x": 540, - "y": 292, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "objects": [ - { - "assetStoreId": "615de0316452630b9f4f6a39decc82e2449b82c1afd1ff24d6470dad2922177b", - "name": "YesButton", - "persistentUuid": "231a774d-826d-4dd5-85d6-b5d4b8ca1d81", - "type": "PanelSpriteButton::PanelSpriteButton", - "variant": "Small Yellow Button", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "LeftPadding": 16, - "RightPadding": 16, - "PressedLabelOffsetY": 2, - "BottomPadding": 32, - "TopPadding": 16, - "HoveredFadeOutDuration": 0.25, - "LabelText": "Yes" - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "YesButton" - } - ] - }, - "events": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [ - { - "effectType": "Scene3D::HemisphereLight", - "name": "3D Ambient Hemisphere Light", - "doubleParameters": { - "elevation": 40, - "intensity": 0.33, - "rotation": 300 - }, - "stringParameters": { - "groundColor": "127;127;127", - "skyColor": "255;255;255", - "top": "Z+" - }, - "booleanParameters": {} - }, - { - "effectType": "Scene3D::DirectionalLight", - "name": "3D Sun Light", - "doubleParameters": { - "distanceFromCamera": 1500, - "elevation": 40, - "frustumSize": 4000, - "intensity": 0.75, - "minimumShadowBias": 0, - "rotation": 300 - }, - "stringParameters": { - "color": "255;255;255", - "shadowQuality": "medium", - "top": "Z+" - }, - "booleanParameters": { - "isCastingShadow": true - } - } - ] - } - ], - "behaviorsSharedData": [ - { - "name": "Animation", - "type": "AnimatableCapability::AnimatableBehavior" - }, - { - "name": "Effect", - "type": "EffectCapability::EffectBehavior" - }, - { - "name": "Flippable", - "type": "FlippableCapability::FlippableBehavior" - }, - { - "name": "Opacity", - "type": "OpacityCapability::OpacityBehavior" - }, - { - "name": "Resizable", - "type": "ResizableCapability::ResizableBehavior" - }, - { - "name": "Scale", - "type": "ScalableCapability::ScalableBehavior" - } - ] } ], "externalEvents": [], @@ -2808,94 +2637,20 @@ } ] }, - "eventsBasedBehaviors": [], - "eventsBasedObjects": [] - }, - { - "author": "", - "category": "User interface", - "dimension": "2D", - "extensionNamespace": "", - "fullName": "Labeled button", - "gdevelopVersion": ">=5.5.230", - "helpPath": "/objects/button", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", - "name": "PanelSpriteButton", - "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", - "shortDescription": "Resizeable button with a label.", - "version": "2.2.0", - "description": [ - "A button that can be used for menus and most labelled buttons of a game. The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", - "", - "There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)." - ], - "origin": { - "identifier": "PanelSpriteButton", - "name": "gdevelop-extension-store" - }, - "tags": [ - "button", - "ui" - ], - "authorIds": [ - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" - ], - "changelog": [ - { - "version": "2.0.0", - "breaking": "- Buttons now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing buttons in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." - } - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if the events are running for the editor.", - "fullName": "Editor is running", - "functionType": "Condition", - "name": "IsInGameEdition", - "private": true, - "sentence": "Events are running for the editor", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();\r", - "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsFunctionsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "functionName": "IsInGameEdition" - } - ] - }, "eventsBasedBehaviors": [ { - "description": "The finite state machine used internally by the button object.", - "fullName": "Button finite state machine", + "description": "", + "fullName": "Draggeable camera area", "helpPath": "", "iconUrl": "", - "name": "ButtonFSM", + "name": "DraggeableCameraArea", "objectType": "", "previewIconUrl": "", - "private": true, "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "doStepPostEvents", + "name": "doStepPreEvents", "sentence": "", "events": [ { @@ -2904,29 +2659,1150 @@ { "type": { "inverted": true, - "value": "PanelSpriteButton::IsInGameEdition" + "value": "MouseButtonFromTextPressed" }, "parameters": [ "", - "" + "\"Left\"" ] } ], - "actions": [], - "events": [ + "actions": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Finite state machine", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsDragged", + "False", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "MouseButtonFromTextPressed" + }, + "parameters": [ + "", + "\"Left\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + }, + { + "type": { + "value": "IsCursorOnObject" + }, + "parameters": [ + "Object", + "", + "", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsDragged", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::IsDragged" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "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": "SetCameraCenterX" + }, + "parameters": [ + "", + "-", + "CursorX(Layer) - StartX", + "Layer", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "!=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "CursorY(Layer) - StartY", + "Layer", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "DragCameraWithPointer::DraggeableCameraArea::IsDragged" + }, + "parameters": [ + "Object", + "Behavior", + "" + ] + } + ], + "actions": [], + "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" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedX", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraX", + "=", + "CameraCenterX(Layer)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedY", + "=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraY", + "=", + "CameraCenterY(Layer)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsMouseWheelScrollingUp" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "IsCursorOnObject" + }, + "parameters": [ + "Object", + "", + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "100", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraY" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "100", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "IsMouseWheelScrollingDown" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "IsCursorOnObject" + }, + "parameters": [ + "Object", + "", + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "100", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraY" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "100", + "" + ] + } + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "SpeedX", + "!=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetCameraCenterX" + }, + "parameters": [ + "", + "+", + "SpeedX * TimeDelta() * LayerTimeScale(Object.Layer())", + "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() * LayerTimeScale(Object.Layer())", + "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" + ] + } + ] + } + ] + } + ] + }, + { + "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": "DragCameraWithPointer::DraggeableCameraArea", + "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": "BooleanVariable" + }, + "parameters": [ + "IsDragged", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "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": "DragCameraWithPointer::DraggeableCameraArea", + "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": "DragCameraWithPointer::DraggeableCameraArea", + "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": "DragCameraWithPointer::DraggeableCameraArea", + "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": "DragCameraWithPointer::DraggeableCameraArea", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPreEvents" + }, + { + "functionName": "IsDragged" + }, + { + "functionName": "TargetedCameraY" + }, + { + "functionName": "SetTargetedCameraY" + }, + { + "functionName": "TargetedCameraX" + }, + { + "functionName": "SetTargetedCameraX" + } + ] + }, + "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", + "hidden": true, + "name": "IsDragged" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "StartX" + }, + { + "value": "", + "type": "Number", + "label": "", + "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": "", + "hidden": true, + "name": "TargetedCameraX" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "TargetedCameraY" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "SpeedX" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "SpeedY" + }, + { + "value": "0.25", + "type": "Number", + "unit": "Second", + "label": "Wheel scrolling duration", + "name": "WheelScrollingDuration" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "OldCameraX" + }, + { + "value": "", + "type": "Number", + "label": "", + "hidden": true, + "name": "OldCameraY" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "OldCameraX" + }, + { + "propertyName": "OldCameraY" + }, + { + "propertyName": "WheelScrollingDuration" + }, + { + "propertyName": "SpeedX" + }, + { + "propertyName": "SpeedY" + }, + { + "propertyName": "TargetedCameraX" + }, + { + "propertyName": "TargetedCameraY" + }, + { + "propertyName": "Layer" + }, + { + "propertyName": "Direction" + }, + { + "propertyName": "StartX" + }, + { + "propertyName": "StartY" + }, + { + "propertyName": "IsDragged" + } + ] + } + } + ], + "eventsBasedObjects": [] + }, + { + "author": "", + "category": "User interface", + "dimension": "2D", + "extensionNamespace": "", + "fullName": "Labeled button", + "gdevelopVersion": ">=5.5.230", + "helpPath": "/objects/button", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K", + "name": "PanelSpriteButton", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg", + "shortDescription": "Resizeable button with a label.", + "version": "2.2.0", + "description": [ + "A button that can be used for menus and most labelled buttons of a game. The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.", + "", + "There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)." + ], + "origin": { + "identifier": "PanelSpriteButton", + "name": "gdevelop-extension-store" + }, + "tags": [ + "button", + "ui" + ], + "authorIds": [ + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + ], + "changelog": [ + { + "version": "2.0.0", + "breaking": "- Buttons now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing buttons in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes." + } + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Check if the events are running for the editor.", + "fullName": "Editor is running", + "functionType": "Condition", + "name": "IsInGameEdition", + "private": true, + "sentence": "Events are running for the editor", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();\r", + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "IsInGameEdition" + } + ] + }, + "eventsBasedBehaviors": [ + { + "description": "The finite state machine used internally by the button object.", + "fullName": "Button finite state machine", + "helpPath": "", + "iconUrl": "", + "name": "ButtonFSM", + "objectType": "", + "previewIconUrl": "", + "private": true, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "PanelSpriteButton::IsInGameEdition" + }, + "parameters": [ + "", + "" + ] + } + ], + "actions": [], + "events": [ + { + "colorB": 228, + "colorG": 176, + "colorR": 74, + "creationTime": 0, + "name": "Finite state machine", + "source": "", + "type": "BuiltinCommonInstructions::Group", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, "g": 230, "r": 255, "textB": 0, @@ -7790,7 +8666,17 @@ "updateIfNotVisible": false, "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "DraggeableCameraArea", + "type": "DragCameraWithPointer::DraggeableCameraArea", + "Direction": "Vertical", + "IsDragged": false, + "StartX": 1.888759594395442e-306, + "StartY": 1.8887595943967276e-306, + "Layer": "" + } + ], "animations": [ { "name": "White", @@ -8079,196 +8965,344 @@ "stringProperties": [], "initialVariables": [] }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 1156, - "keepRatio": true, - "layer": "", - "name": "ContentBackground", - "persistentUuid": "866bf29b-8a83-4b1b-988d-fc09559295d8", - "width": 440, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": { - "grid": false, - "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, - "gridDepth": 32, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridOffsetZ": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 1.3993569068236673, - "windowMask": false, - "selectedLayer": "", - "gameEditorMode": "instances-editor" - }, - "eventsFunctions": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 1156, + "keepRatio": true, + "layer": "", + "name": "ContentBackground", + "persistentUuid": "866bf29b-8a83-4b1b-988d-fc09559295d8", + "width": 440, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.3993569068236673, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + }, + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "Scrollbar::Scrollbar::IsThumbDragged" + }, + "parameters": [ + "ScrollBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "Scrollbar::SetPositionFromCamera" + }, + "parameters": [ + "", + "ScrollBar", + "", + "" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mask", + "DraggeableCameraArea", + "yes" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::IsThumbDragged" + }, + "parameters": [ + "ScrollBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mask", + "DraggeableCameraArea", + "no" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::SetCameraFromPosition" + }, + "parameters": [ + "", + "ScrollBar", + "\"\"", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", + "type": "object" + } + ], + "objectGroups": [] + }, { "fullName": "", "functionType": "Action", - "name": "doStepPostEvents", + "name": "onCreated", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "BuiltinCommonInstructions::Or" + "value": "Scrollbar::Scrollbar::SetContentLength" }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::And" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "MouseButtonFromTextPressed" - }, - "parameters": [ - "", - "\"Left\"" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - }, - { - "type": { - "value": "IsCursorOnObject" - }, - "parameters": [ - "Mask", - "", - "", - "" - ] - } - ] - }, - { - "type": { - "value": "DragCameraWithPointer::IsCameraDragged" - }, - "parameters": [ - "", - "" - ] - } + "parameters": [ + "ScrollBar", + "=", + "ContentBackground.Height()", + "" ] - } - ], - "actions": [], - "events": [ + }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Scrollbar::Scrollbar::IsThumbDragged" - }, - "parameters": [ - "ScrollBar", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "DragCameraWithPointer::DragCameraWithPointer" - }, - "parameters": [ - "", - "0", - "", - "\"vertical\"", - "Left", - "" - ] - }, - { - "type": { - "value": "Scrollbar::SetPositionFromCamera" - }, - "parameters": [ - "", - "ScrollBar", - "", - "" - ] - } + "type": { + "value": "ShowLayer" + }, + "parameters": [ + "", + "\"Mask\"" + ] + }, + { + "type": { + "value": "SpriteMasking::Mask" + }, + "parameters": [ + "", + "Content", + "Mask", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", + "type": "object" + } + ], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "onCreated" + }, + { + "functionName": "doStepPostEvents" + } + ] + }, + "propertyDescriptors": [ + { + "value": "", + "type": "Boolean", + "label": "", + "hidden": true, + "name": "IsDragging" + } + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "IsDragging" + } + ] + }, + "variants": [] + } + ] + }, + { + "author": "", + "category": "Visual effect", + "dimension": "", + "extensionNamespace": "", + "fullName": "Rolling counter", + "gdevelopVersion": ">=5.5.222", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNvcnQtbnVtZXJpYy12YXJpYW50IiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTcuNzgsN0M5LjA4LDcuMDQgMTAsNy41MyAxMC41Nyw4LjQ2QzExLjEzLDkuNCAxMS40MSwxMC41NiAxMS4zOSwxMS45NUMxMS40LDEzLjUgMTEuMDksMTQuNzMgMTAuNSwxNS42MkM5Ljg4LDE2LjUgOC45NSwxNi45NyA3LjcxLDE3QzYuNDUsMTYuOTYgNS41NCwxNi41IDQuOTYsMTUuNTZDNC4zOCwxNC42MyA0LjA5LDEzLjQ1IDQuMDksMTJDNC4wOSwxMC41NSA0LjM5LDkuMzYgNSw4LjQ0QzUuNTksNy41IDYuNSw3LjA0IDcuNzgsN003Ljc1LDguNjNDNy4zMSw4LjYzIDYuOTYsOC45IDYuNyw5LjQ2QzYuNDQsMTAgNi4zMiwxMC44NyA2LjMyLDEyQzYuMzEsMTMuMTUgNi40NCwxNCA2LjY5LDE0LjU0QzYuOTUsMTUuMSA3LjMxLDE1LjM3IDcuNzcsMTUuMzdDOC42OSwxNS4zNyA5LjE2LDE0LjI0IDkuMTcsMTJDOS4xNyw5Ljc3IDguNyw4LjY1IDcuNzUsOC42M00xMy4zMywxN1YxNS4yMkwxMy43NiwxNS4yNEwxNC4zLDE1LjIyTDE1LjM0LDE1LjAzQzE1LjY4LDE0LjkyIDE2LDE0Ljc4IDE2LjI2LDE0LjU4QzE2LjU5LDE0LjM1IDE2Ljg2LDE0LjA4IDE3LjA3LDEzLjc2QzE3LjI5LDEzLjQ1IDE3LjQ0LDEzLjEyIDE3LjUzLDEyLjc4TDE3LjUsMTIuNzdDMTcuMDUsMTMuMTkgMTYuMzgsMTMuNCAxNS40NywxMy40MUMxNC42MiwxMy40IDEzLjkxLDEzLjE1IDEzLjM0LDEyLjY1QzEyLjc3LDEyLjE1IDEyLjUsMTEuNDMgMTIuNDYsMTAuNUMxMi40Nyw5LjUgMTIuODEsOC42OSAxMy40Nyw4LjAzQzE0LjE0LDcuMzcgMTUsNy4wMyAxNi4xMiw3QzE3LjM3LDcuMDQgMTguMjksNy40NSAxOC44OCw4LjI0QzE5LjQ3LDkgMTkuNzYsMTAgMTkuNzYsMTEuMTlDMTkuNzUsMTIuMTUgMTkuNjEsMTMgMTkuMzIsMTMuNzZDMTkuMDMsMTQuNSAxOC42NCwxNS4xMyAxOC4xMiwxNS42NEMxNy42NiwxNi4wNiAxNy4xMSwxNi4zOCAxNi40NywxNi42MUMxNS44MywxNi44MyAxNS4xMiwxNi45NiAxNC4zNCwxN0gxMy4zM00xNi4wNiw4LjYzQzE1LjY1LDguNjQgMTUuMzIsOC44IDE1LjA2LDkuMTFDMTQuODEsOS40MiAxNC42OCw5Ljg0IDE0LjY4LDEwLjM2QzE0LjY4LDEwLjggMTQuOCwxMS4xNiAxNS4wMywxMS40NkMxNS4yNywxMS43NyAxNS42MywxMS45MiAxNi4xMSwxMS45M0MxNi40MywxMS45MyAxNi43LDExLjg2IDE2LjkyLDExLjc0QzE3LjE0LDExLjYxIDE3LjMsMTEuNDYgMTcuNDEsMTEuMjhDMTcuNSwxMS4xNyAxNy41MywxMC45NyAxNy41MywxMC43MUMxNy41NCwxMC4xNiAxNy40Myw5LjY5IDE3LjIsOS4yOEMxNi45Nyw4Ljg3IDE2LjU5LDguNjUgMTYuMDYsOC42M005LjI1LDVMMTIuNSwxLjc1TDE1Ljc1LDVIOS4yNU0xNS43NSwxOUwxMi41LDIyLjI1TDkuMjUsMTlIMTUuNzVaIiAvPjwvc3ZnPg==", + "name": "RollingCounter", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/e509cccd7fb426978c4a79b639670f624f773a886848d288a12be5c28dd7d380_sort-numeric-variant.svg", + "shortDescription": "Smoothly change a counter value in a text object.", + "version": "1.2.0", + "description": "Smoothly change a counter value in a text object.", + "origin": { + "identifier": "RollingCounter", + "name": "gdevelop-extension-store" + }, + "tags": [ + "score", + "animation", + "text" + ], + "authorIds": [ + "dt0tRnf2kHWJnjkrpnzTzNj9Yc63" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Check if the events are running for the editor.", + "fullName": "Editor is running", + "functionType": "Condition", + "name": "IsInGameEdition", + "private": true, + "sentence": "Events are running for the editor", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "const game = runtimeScene.getGame();\r", + "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" + ], + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ], + "parameters": [], + "objectGroups": [] + } + ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "IsInGameEdition" + } + ] + }, + "eventsBasedBehaviors": [ + { + "description": "Smoothly changes a counter value in a text object.", + "fullName": "Rolling counter", + "helpPath": "", + "iconUrl": "", + "name": "RollingCounter", + "objectType": "", + "previewIconUrl": "", + "quickCustomizationVisibility": "hidden", + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DisplayedValue", + "+", + "Speed * TimeDelta() * LayerTimeScale(Object.Layer())" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsMouseWheelScrollingUp" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::SetScrollPosition" - }, - "parameters": [ - "ScrollBar", - "-", - "100", - "" - ] - } + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "sign(Speed)", + "=", + "sign(DisplayedValue - CounterValue)" ] - }, + } + ], + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsMouseWheelScrollingDown" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::SetScrollPosition" - }, - "parameters": [ - "ScrollBar", - "+", - "100", - "" - ] - } + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DisplayedValue", + "=", + "CounterValue" ] } ] @@ -8279,13 +9313,13 @@ "actions": [ { "type": { - "value": "Scrollbar::SetCameraFromPosition" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ - "", - "ScrollBar", - "\"\"", - "" + "Object", + "Text", + "=", + "Prefix + ToString(roundTo(round(DisplayedValue / Increment) * Increment, 9)) + Suffix" ] } ] @@ -8295,16 +9329,62 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "the value of the counter.", + "fullName": "Counter value", + "functionType": "ExpressionAndCondition", + "name": "Value", + "sentence": "the counter value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "CounterValue" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" } ], "objectGroups": [] }, { "fullName": "", - "functionType": "Action", - "name": "onCreated", + "functionType": "ActionWithOperator", + "getterName": "Value", + "name": "SetValue", "sentence": "", "events": [ { @@ -8313,35 +9393,90 @@ "actions": [ { "type": { - "value": "Scrollbar::Scrollbar::SetContentLength" + "value": "SetNumberVariable" }, "parameters": [ - "ScrollBar", + "CounterValue", "=", - "ContentBackground.Height()", - "" + "Value" ] }, { "type": { - "value": "ShowLayer" + "value": "SetNumberVariable" }, "parameters": [ - "", - "\"Mask\"" + "Speed", + "=", + "(CounterValue - DisplayedValue) / Duration" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "SpriteMasking::Mask" + "value": "RollingCounter::IsInGameEdition" }, "parameters": [ "", - "Content", - "Mask", "" ] } + ], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Object", + "Text", + "=", + "Prefix + ToString(Value) + Suffix" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "Directly display the counter value without playing the animation.", + "fullName": "Jump to the counter animation end", + "functionType": "Action", + "name": "ResetDisplayedValue", + "sentence": "Jump to the counter animation end of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "DisplayedValue", + "=", + "CounterValue" + ] + } ] } ], @@ -8349,8 +9484,13 @@ { "description": "Object", "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", "type": "object" + }, + { + "description": "Behavior", + "name": "Behavior", + "supplementaryInformation": "RollingCounter::RollingCounter", + "type": "behavior" } ], "objectGroups": [] @@ -8360,33 +9500,110 @@ "folderName": "__ROOT", "children": [ { - "functionName": "onCreated" + "functionName": "doStepPreEvents" }, { - "functionName": "doStepPostEvents" + "functionName": "Value" + }, + { + "functionName": "SetValue" + }, + { + "functionName": "ResetDisplayedValue" } ] }, "propertyDescriptors": [ { "value": "", - "type": "Boolean", + "type": "Behavior", + "label": "Text capability", + "extraInformation": [ + "TextContainerCapability::TextContainerBehavior" + ], + "choices": [], + "name": "Text" + }, + { + "value": "Score: ", + "type": "String", + "label": "Prefix", + "name": "Prefix" + }, + { + "value": "", + "type": "String", + "label": "Suffix", + "name": "Suffix" + }, + { + "value": "1", + "type": "Number", + "unit": "Second", + "label": "Animation duration", + "name": "Duration" + }, + { + "value": "1", + "type": "Number", + "unit": "Dimensionless", + "label": "Increment", + "name": "Increment" + }, + { + "value": "0", + "type": "Number", "label": "", "hidden": true, - "name": "IsDragging" + "name": "CounterValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "hidden": true, + "name": "DisplayedValue" + }, + { + "value": "0", + "type": "Number", + "label": "", + "hidden": true, + "name": "Speed" } ], "propertiesFolderStructure": { "folderName": "__ROOT", "children": [ { - "propertyName": "IsDragging" + "propertyName": "Text" + }, + { + "propertyName": "Prefix" + }, + { + "propertyName": "Suffix" + }, + { + "propertyName": "Duration" + }, + { + "propertyName": "Increment" + }, + { + "propertyName": "CounterValue" + }, + { + "propertyName": "DisplayedValue" + }, + { + "propertyName": "Speed" } ] - }, - "variants": [] + } } - ] + ], + "eventsBasedObjects": [] } ], "externalLayouts": [] From f332ebd1333780b84db9013c1f32501a90c2792a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 7 May 2026 12:06:27 +0200 Subject: [PATCH 03/12] Handle inertia --- examples/scrollbar/scrollbar.json | 1915 ++++++++++++++--------------- 1 file changed, 921 insertions(+), 994 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 27195d09f..75ef79366 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -618,7 +618,24 @@ "updateIfNotVisible": false, "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "DraggeableCameraArea", + "type": "DragCameraWithPointer::DraggeableCameraArea", + "Direction": "Vertical", + "IsDragged": false, + "StartX": 9.788238970689376e-306, + "StartY": 9.788238970694519e-306, + "Layer": "Scrolled", + "TargetedCameraX": 9.788238970694519e-306, + "TargetedCameraY": 9.788238970694519e-306, + "WheeledSpeedX": 9.788238970694519e-306, + "WheeledSpeedY": 9.788238970694519e-306, + "WheelScrollingDuration": 0.25, + "OldCameraX": 0.2500000000002275, + "OldCameraY": 0.2500000000002275 + } + ], "animations": [ { "name": "White", @@ -758,109 +775,61 @@ "conditions": [ { "type": { - "value": "IsCursorOnObject" + "inverted": true, + "value": "Scrollbar::Scrollbar::IsThumbDragged" }, "parameters": [ - "ContentBackground", - "", - "", + "ScrollBar", "" ] } ], - "actions": [], - "events": [ + "actions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Scrollbar::Scrollbar::IsThumbDragged" - }, - "parameters": [ - "ScrollBar", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "DragCameraWithPointer::DragCameraWithPointer" - }, - "parameters": [ - "", - "0", - "\"Scrolled\"", - "\"vertical\"", - "Left", - "" - ] - }, - { - "type": { - "value": "Scrollbar::SetPositionFromCamera" - }, - "parameters": [ - "", - "ScrollBar", - "\"Scrolled\"", - "" - ] - } + "type": { + "value": "Scrollbar::SetPositionFromCamera" + }, + "parameters": [ + "", + "ScrollBar", + "\"Scrolled\"", + "" ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsMouseWheelScrollingUp" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::SetScrollPosition" - }, - "parameters": [ - "ScrollBar", - "-", - "100", - "" - ] - } + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mask", + "DraggeableCameraArea", + "yes" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsMouseWheelScrollingDown" - }, - "parameters": [ - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::SetScrollPosition" - }, - "parameters": [ - "ScrollBar", - "+", - "100", - "" - ] - } + "type": { + "value": "Scrollbar::Scrollbar::IsThumbDragged" + }, + "parameters": [ + "ScrollBar", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Mask", + "DraggeableCameraArea", + "no" ] } ] @@ -1063,6 +1032,10 @@ "name": "Animation", "type": "AnimatableCapability::AnimatableBehavior" }, + { + "name": "DraggeableCameraArea", + "type": "DragCameraWithPointer::DraggeableCameraArea" + }, { "name": "Effect", "type": "EffectCapability::EffectBehavior" @@ -2624,6 +2597,81 @@ ], "parameters": [], "objectGroups": [] + }, + { + "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": { @@ -2634,6 +2682,9 @@ }, { "functionName": "IsCameraDragged" + }, + { + "functionName": "MoveToZero" } ] }, @@ -2658,24 +2709,24 @@ "conditions": [ { "type": { - "inverted": true, - "value": "MouseButtonFromTextPressed" + "value": "NumberVariable" }, "parameters": [ - "", - "\"Left\"" + "OldCameraX", + "!=", + "CameraCenterX(Layer)" ] } ], "actions": [ { "type": { - "value": "SetBooleanVariable" + "value": "SetNumberVariable" }, "parameters": [ - "IsDragged", - "False", - "" + "SpeedX", + "=", + "0" ] } ] @@ -2685,89 +2736,76 @@ "conditions": [ { "type": { - "value": "MouseButtonFromTextPressed" - }, - "parameters": [ - "", - "\"Left\"" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - }, - { - "type": { - "value": "IsCursorOnObject" + "value": "NumberVariable" }, "parameters": [ - "Object", - "", - "", - "" + "OldCameraY", + "!=", + "CameraCenterY(Layer)" ] } ], "actions": [ { "type": { - "value": "SetBooleanVariable" + "value": "SetNumberVariable" }, "parameters": [ - "IsDragged", - "True", - "" + "SpeedY", + "=", + "0" ] } ] }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::IsDragged" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [], + "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": [] - } - ], - "actions": [ + }, { "type": { - "value": "SetNumberVariable" + "value": "IsCursorOnObject" }, "parameters": [ - "StartX", - "=", - "CursorX(Layer)" + "Object", + "", + "", + "" ] - }, + } + ], + "actions": [ { "type": { - "value": "SetNumberVariable" + "value": "SetStringVariable" }, "parameters": [ - "StartY", + "State", "=", - "CursorY(Layer)" + "\"Dragged\"" ] } ] @@ -2780,163 +2818,27 @@ "value": "StringVariable" }, "parameters": [ - "Direction", - "!=", - "\"Vertical\"" + "State", + "=", + "\"Dragged\"" ] } ], "actions": [ { "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "-", - "CursorX(Layer) - StartX", - "Layer", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Direction", - "!=", - "\"Horizontal\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "-", - "CursorY(Layer) - StartY", - "Layer", - "" - ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "DragCameraWithPointer::DraggeableCameraArea::IsDragged" - }, - "parameters": [ - "Object", - "Behavior", - "" - ] - } - ], - "actions": [], - "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" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" + "value": "SetNumberVariable" }, "parameters": [ "SpeedX", "=", "0" ] - } - ], - "actions": [ + }, { "type": { "value": "SetNumberVariable" }, - "parameters": [ - "TargetedCameraX", - "=", - "CameraCenterX(Layer)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "NumberVariable" - }, "parameters": [ "SpeedY", "=", @@ -2944,44 +2846,40 @@ ] } ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedCameraY", - "=", - "CameraCenterY(Layer)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "events": [ { - "type": { - "value": "IsMouseWheelScrollingUp" - }, - "parameters": [ - "" + "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": { - "value": "IsCursorOnObject" - }, - "parameters": [ - "Object", - "", - "", - "" - ] - } - ], - "actions": [], - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -2991,71 +2889,36 @@ }, "parameters": [ "Direction", - "=", - "\"Horizontal\"" + "!=", + "\"Vertical\"" ] } ], "actions": [ { "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", - "-", - "100", - "" + "SpeedX", + "=", + "(CursorX(Layer) - StartX) / TimeDelta()" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Else", - "conditions": [], - "actions": [ + }, { "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraY" + "value": "SetCameraCenterX" }, "parameters": [ - "Object", - "Behavior", + "", "-", - "100", + "CursorX(Layer) - StartX", + "Layer", "" ] } ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "IsMouseWheelScrollingDown" - }, - "parameters": [ - "" - ] }, - { - "type": { - "value": "IsCursorOnObject" - }, - "parameters": [ - "Object", - "", - "", - "" - ] - } - ], - "actions": [], - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -3065,7 +2928,7 @@ }, "parameters": [ "Direction", - "=", + "!=", "\"Horizontal\"" ] } @@ -3073,32 +2936,51 @@ "actions": [ { "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + "value": "SetNumberVariable" }, "parameters": [ - "Object", - "Behavior", - "+", - "100", + "SpeedY", + "=", + "(CursorY(Layer) - StartY) / TimeDelta()" + ] + }, + { + "type": { + "value": "SetCameraCenterY" + }, + "parameters": [ + "", + "-", + "CursorY(Layer) - StartY", + "Layer", "" ] } ] }, { - "type": "BuiltinCommonInstructions::Else", - "conditions": [], - "actions": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraY" + "inverted": true, + "value": "MouseButtonFromTextPressed" }, "parameters": [ - "Object", - "Behavior", - "+", - "100", - "" + "", + "\"Left\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "State", + "=", + "\"Inertia\"" ] } ] @@ -3110,55 +2992,167 @@ "conditions": [ { "type": { - "value": "NumberVariable" + "value": "StringVariable" }, "parameters": [ - "SpeedX", - "!=", - "0" + "State", + "=", + "\"Inertia\"" ] } ], - "actions": [ + "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", + "=", + "DragCameraWithPointer::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", + "=", + "DragCameraWithPointer::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": "IsMouseWheelScrollingUp" + }, + "parameters": [ + "" + ] + }, { "type": { - "value": "SetCameraCenterX" + "value": "IsCursorOnObject" }, "parameters": [ + "Object", + "", "", - "+", - "SpeedX * TimeDelta() * LayerTimeScale(Object.Layer())", - "Layer", "" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "StringVariable" }, "parameters": [ - "sign(SpeedX)", - "=", - "sign(CameraCenterX(Layer) - TargetedCameraX)" + "State", + "!=", + "\"Wheeled\"" ] } ], "actions": [ { "type": { - "value": "SetCameraCenterX" + "value": "SetStringVariable" }, "parameters": [ - "", + "State", "=", + "\"Wheeled\"" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ "TargetedCameraX", - "Layer", - "" + "=", + "CameraCenterX(Layer)" ] }, { @@ -3166,9 +3160,56 @@ "value": "SetNumberVariable" }, "parameters": [ - "SpeedX", + "TargetedCameraY", "=", - "0" + "CameraCenterY(Layer)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "WheelStepSize", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraY" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "WheelStepSize", + "" ] } ] @@ -3180,55 +3221,49 @@ "conditions": [ { "type": { - "value": "NumberVariable" + "value": "IsMouseWheelScrollingDown" }, "parameters": [ - "SpeedY", - "!=", - "0" + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetCameraCenterY" + "value": "IsCursorOnObject" }, "parameters": [ + "Object", + "", "", - "+", - "SpeedY * TimeDelta() * LayerTimeScale(Object.Layer())", - "Layer", "" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "StringVariable" }, "parameters": [ - "sign(SpeedY)", - "=", - "sign(CameraCenterY(Layer) - TargetedCameraY)" + "State", + "!=", + "\"Wheeled\"" ] } ], "actions": [ { "type": { - "value": "SetCameraCenterY" + "value": "SetStringVariable" }, "parameters": [ - "", + "State", "=", - "TargetedCameraY", - "Layer", - "" + "\"Wheeled\"" ] }, { @@ -3236,37 +3271,300 @@ "value": "SetNumberVariable" }, "parameters": [ - "SpeedY", + "TargetedCameraX", "=", - "0" + "CameraCenterX(Layer)" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "TargetedCameraY", + "=", + "CameraCenterY(Layer)" ] } ] - } - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "OldCameraX", - "=", - "CameraCenterX(Layer)" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "OldCameraY", + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + }, + "parameters": [ + "Object", + "Behavior", + "+", + "WheelStepSize", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::DraggeableCameraArea::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)" ] @@ -3301,12 +3599,12 @@ "conditions": [ { "type": { - "value": "BooleanVariable" + "value": "StringVariable" }, "parameters": [ - "IsDragged", - "True", - "" + "State", + "=", + "\"Dragged\"" ] } ], @@ -3568,6 +3866,7 @@ "value": "", "type": "Boolean", "label": "Camera is being dragged", + "group": "Dragging", "hidden": true, "name": "IsDragged" }, @@ -3575,6 +3874,7 @@ "value": "", "type": "Number", "label": "", + "group": "Dragging", "hidden": true, "name": "StartX" }, @@ -3582,6 +3882,7 @@ "value": "", "type": "Number", "label": "", + "group": "Dragging", "hidden": true, "name": "StartY" }, @@ -3596,6 +3897,7 @@ "value": "", "type": "Number", "label": "", + "group": "Wheel", "hidden": true, "name": "TargetedCameraX" }, @@ -3603,83 +3905,127 @@ "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": "SpeedX" + "name": "OldCameraX" }, { "value": "", "type": "Number", "label": "", "hidden": true, - "name": "SpeedY" + "name": "OldCameraY" }, { - "value": "0.25", + "value": "120", "type": "Number", - "unit": "Second", - "label": "Wheel scrolling duration", - "name": "WheelScrollingDuration" + "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": "OldCameraX" + "name": "SpeedX" }, { "value": "", "type": "Number", "label": "", "hidden": true, - "name": "OldCameraY" + "name": "SpeedY" + }, + { + "value": "800", + "type": "Number", + "unit": "PixelAcceleration", + "label": "", + "group": "Dragging", + "name": "InertiaDeceleration" } ], "propertiesFolderStructure": { "folderName": "__ROOT", "children": [ { - "propertyName": "OldCameraX" - }, - { - "propertyName": "OldCameraY" - }, - { - "propertyName": "WheelScrollingDuration" - }, - { - "propertyName": "SpeedX" + "propertyName": "State" }, { - "propertyName": "SpeedY" + "propertyName": "Layer" }, { - "propertyName": "TargetedCameraX" + "propertyName": "Direction" }, { - "propertyName": "TargetedCameraY" + "propertyName": "OldCameraX" }, { - "propertyName": "Layer" + "propertyName": "OldCameraY" }, { - "propertyName": "Direction" + "propertyName": "SpeedX" }, { - "propertyName": "StartX" + "propertyName": "SpeedY" }, { - "propertyName": "StartY" + "folderName": "Dragging", + "children": [ + { + "propertyName": "InertiaDeceleration" + }, + { + "propertyName": "IsDragged" + }, + { + "propertyName": "StartX" + }, + { + "propertyName": "StartY" + } + ] }, { - "propertyName": "IsDragged" + "folderName": "Wheel", + "children": [ + { + "propertyName": "WheelStepSize" + }, + { + "propertyName": "WheelScrollingDuration" + }, + { + "propertyName": "TargetedCameraX" + }, + { + "propertyName": "TargetedCameraY" + } + ] } ] } @@ -8968,423 +9314,141 @@ { "angle": 0, "customSize": true, - "depth": 1, - "height": 1156, - "keepRatio": true, - "layer": "", - "name": "ContentBackground", - "persistentUuid": "866bf29b-8a83-4b1b-988d-fc09559295d8", - "width": 440, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": { - "grid": false, - "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, - "gridDepth": 32, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridOffsetZ": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 1.3993569068236673, - "windowMask": false, - "selectedLayer": "", - "gameEditorMode": "instances-editor" - }, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Scrollbar::Scrollbar::IsThumbDragged" - }, - "parameters": [ - "ScrollBar", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scrollbar::SetPositionFromCamera" - }, - "parameters": [ - "", - "ScrollBar", - "", - "" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Mask", - "DraggeableCameraArea", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::IsThumbDragged" - }, - "parameters": [ - "ScrollBar", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Mask", - "DraggeableCameraArea", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Scrollbar::SetCameraFromPosition" - }, - "parameters": [ - "", - "ScrollBar", - "\"\"", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::SetContentLength" - }, - "parameters": [ - "ScrollBar", - "=", - "ContentBackground.Height()", - "" - ] - }, - { - "type": { - "value": "ShowLayer" - }, - "parameters": [ - "", - "\"Mask\"" - ] - }, - { - "type": { - "value": "SpriteMasking::Mask" - }, - "parameters": [ - "", - "Content", - "Mask", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "eventsFunctionsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "functionName": "onCreated" - }, - { - "functionName": "doStepPostEvents" - } - ] - }, - "propertyDescriptors": [ - { - "value": "", - "type": "Boolean", - "label": "", - "hidden": true, - "name": "IsDragging" - } - ], - "propertiesFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "propertyName": "IsDragging" - } - ] - }, - "variants": [] - } - ] - }, - { - "author": "", - "category": "Visual effect", - "dimension": "", - "extensionNamespace": "", - "fullName": "Rolling counter", - "gdevelopVersion": ">=5.5.222", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLXNvcnQtbnVtZXJpYy12YXJpYW50IiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTcuNzgsN0M5LjA4LDcuMDQgMTAsNy41MyAxMC41Nyw4LjQ2QzExLjEzLDkuNCAxMS40MSwxMC41NiAxMS4zOSwxMS45NUMxMS40LDEzLjUgMTEuMDksMTQuNzMgMTAuNSwxNS42MkM5Ljg4LDE2LjUgOC45NSwxNi45NyA3LjcxLDE3QzYuNDUsMTYuOTYgNS41NCwxNi41IDQuOTYsMTUuNTZDNC4zOCwxNC42MyA0LjA5LDEzLjQ1IDQuMDksMTJDNC4wOSwxMC41NSA0LjM5LDkuMzYgNSw4LjQ0QzUuNTksNy41IDYuNSw3LjA0IDcuNzgsN003Ljc1LDguNjNDNy4zMSw4LjYzIDYuOTYsOC45IDYuNyw5LjQ2QzYuNDQsMTAgNi4zMiwxMC44NyA2LjMyLDEyQzYuMzEsMTMuMTUgNi40NCwxNCA2LjY5LDE0LjU0QzYuOTUsMTUuMSA3LjMxLDE1LjM3IDcuNzcsMTUuMzdDOC42OSwxNS4zNyA5LjE2LDE0LjI0IDkuMTcsMTJDOS4xNyw5Ljc3IDguNyw4LjY1IDcuNzUsOC42M00xMy4zMywxN1YxNS4yMkwxMy43NiwxNS4yNEwxNC4zLDE1LjIyTDE1LjM0LDE1LjAzQzE1LjY4LDE0LjkyIDE2LDE0Ljc4IDE2LjI2LDE0LjU4QzE2LjU5LDE0LjM1IDE2Ljg2LDE0LjA4IDE3LjA3LDEzLjc2QzE3LjI5LDEzLjQ1IDE3LjQ0LDEzLjEyIDE3LjUzLDEyLjc4TDE3LjUsMTIuNzdDMTcuMDUsMTMuMTkgMTYuMzgsMTMuNCAxNS40NywxMy40MUMxNC42MiwxMy40IDEzLjkxLDEzLjE1IDEzLjM0LDEyLjY1QzEyLjc3LDEyLjE1IDEyLjUsMTEuNDMgMTIuNDYsMTAuNUMxMi40Nyw5LjUgMTIuODEsOC42OSAxMy40Nyw4LjAzQzE0LjE0LDcuMzcgMTUsNy4wMyAxNi4xMiw3QzE3LjM3LDcuMDQgMTguMjksNy40NSAxOC44OCw4LjI0QzE5LjQ3LDkgMTkuNzYsMTAgMTkuNzYsMTEuMTlDMTkuNzUsMTIuMTUgMTkuNjEsMTMgMTkuMzIsMTMuNzZDMTkuMDMsMTQuNSAxOC42NCwxNS4xMyAxOC4xMiwxNS42NEMxNy42NiwxNi4wNiAxNy4xMSwxNi4zOCAxNi40NywxNi42MUMxNS44MywxNi44MyAxNS4xMiwxNi45NiAxNC4zNCwxN0gxMy4zM00xNi4wNiw4LjYzQzE1LjY1LDguNjQgMTUuMzIsOC44IDE1LjA2LDkuMTFDMTQuODEsOS40MiAxNC42OCw5Ljg0IDE0LjY4LDEwLjM2QzE0LjY4LDEwLjggMTQuOCwxMS4xNiAxNS4wMywxMS40NkMxNS4yNywxMS43NyAxNS42MywxMS45MiAxNi4xMSwxMS45M0MxNi40MywxMS45MyAxNi43LDExLjg2IDE2LjkyLDExLjc0QzE3LjE0LDExLjYxIDE3LjMsMTEuNDYgMTcuNDEsMTEuMjhDMTcuNSwxMS4xNyAxNy41MywxMC45NyAxNy41MywxMC43MUMxNy41NCwxMC4xNiAxNy40Myw5LjY5IDE3LjIsOS4yOEMxNi45Nyw4Ljg3IDE2LjU5LDguNjUgMTYuMDYsOC42M005LjI1LDVMMTIuNSwxLjc1TDE1Ljc1LDVIOS4yNU0xNS43NSwxOUwxMi41LDIyLjI1TDkuMjUsMTlIMTUuNzVaIiAvPjwvc3ZnPg==", - "name": "RollingCounter", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/e509cccd7fb426978c4a79b639670f624f773a886848d288a12be5c28dd7d380_sort-numeric-variant.svg", - "shortDescription": "Smoothly change a counter value in a text object.", - "version": "1.2.0", - "description": "Smoothly change a counter value in a text object.", - "origin": { - "identifier": "RollingCounter", - "name": "gdevelop-extension-store" - }, - "tags": [ - "score", - "animation", - "text" - ], - "authorIds": [ - "dt0tRnf2kHWJnjkrpnzTzNj9Yc63" - ], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [ - { - "description": "Check if the events are running for the editor.", - "fullName": "Editor is running", - "functionType": "Condition", - "name": "IsInGameEdition", - "private": true, - "sentence": "Events are running for the editor", - "events": [ - { - "type": "BuiltinCommonInstructions::JsCode", - "inlineCode": [ - "const game = runtimeScene.getGame();\r", - "eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();" - ], - "parameterObjects": "", - "useStrict": true, - "eventsSheetExpanded": false - } - ], - "parameters": [], - "objectGroups": [] - } - ], - "eventsFunctionsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "functionName": "IsInGameEdition" - } - ] - }, - "eventsBasedBehaviors": [ - { - "description": "Smoothly changes a counter value in a text object.", - "fullName": "Rolling counter", - "helpPath": "", - "iconUrl": "", - "name": "RollingCounter", - "objectType": "", - "previewIconUrl": "", - "quickCustomizationVisibility": "hidden", + "depth": 1, + "height": 1156, + "keepRatio": true, + "layer": "", + "name": "ContentBackground", + "persistentUuid": "866bf29b-8a83-4b1b-988d-fc09559295d8", + "width": 440, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "editionSettings": { + "grid": false, + "gridType": "rectangular", + "gridWidth": 32, + "gridHeight": 32, + "gridDepth": 32, + "gridOffsetX": 0, + "gridOffsetY": 0, + "gridOffsetZ": 0, + "gridColor": 10401023, + "gridAlpha": 0.8, + "snap": false, + "zoomFactor": 1.3993569068236673, + "windowMask": false, + "selectedLayer": "", + "gameEditorMode": "instances-editor" + }, "eventsFunctions": [ { "fullName": "", "functionType": "Action", - "name": "doStepPreEvents", + "name": "doStepPostEvents", "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetNumberVariable" + "inverted": true, + "value": "Scrollbar::Scrollbar::IsThumbDragged" }, "parameters": [ - "DisplayedValue", - "+", - "Speed * TimeDelta() * LayerTimeScale(Object.Layer())" + "ScrollBar", + "" ] } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + ], + "actions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "Scrollbar::SetPositionFromCamera" }, "parameters": [ - "sign(Speed)", - "=", - "sign(DisplayedValue - CounterValue)" + "", + "ScrollBar", + "", + "" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetNumberVariable" + "value": "ActivateBehavior" }, "parameters": [ - "DisplayedValue", - "=", - "CounterValue" + "Mask", + "DraggeableCameraArea", + "yes" ] } ] }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::IsThumbDragged" + }, + "parameters": [ + "ScrollBar", + "" + ] + } + ], "actions": [ { "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" + "value": "ActivateBehavior" }, "parameters": [ - "Object", - "Text", - "=", - "Prefix + ToString(roundTo(round(DisplayedValue / Increment) * Increment, 9)) + Suffix" + "Mask", + "DraggeableCameraArea", + "no" ] } ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "RollingCounter::RollingCounter", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "the value of the counter.", - "fullName": "Counter value", - "functionType": "ExpressionAndCondition", - "name": "Value", - "sentence": "the counter value", - "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ { "type": { - "value": "SetReturnNumber" + "value": "Scrollbar::SetCameraFromPosition" }, "parameters": [ - "CounterValue" + "", + "ScrollBar", + "\"\"", + "" ] } ] } ], - "expressionType": { - "type": "expression" - }, "parameters": [ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "RollingCounter::RollingCounter", - "type": "behavior" } ], "objectGroups": [] }, { "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "Value", - "name": "SetValue", + "functionType": "Action", + "name": "onCreated", "sentence": "", "events": [ { @@ -9393,90 +9457,35 @@ "actions": [ { "type": { - "value": "SetNumberVariable" + "value": "Scrollbar::Scrollbar::SetContentLength" }, "parameters": [ - "CounterValue", + "ScrollBar", "=", - "Value" + "ContentBackground.Height()", + "" ] }, { "type": { - "value": "SetNumberVariable" + "value": "ShowLayer" }, "parameters": [ - "Speed", - "=", - "(CounterValue - DisplayedValue) / Duration" + "", + "\"Mask\"" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + }, { "type": { - "value": "RollingCounter::IsInGameEdition" + "value": "SpriteMasking::Mask" }, "parameters": [ "", + "Content", + "Mask", "" ] } - ], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Object", - "Text", - "=", - "Prefix + ToString(Value) + Suffix" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "RollingCounter::RollingCounter", - "type": "behavior" - } - ], - "objectGroups": [] - }, - { - "description": "Directly display the counter value without playing the animation.", - "fullName": "Jump to the counter animation end", - "functionType": "Action", - "name": "ResetDisplayedValue", - "sentence": "Jump to the counter animation end of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "DisplayedValue", - "=", - "CounterValue" - ] - } ] } ], @@ -9484,13 +9493,8 @@ { "description": "Object", "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", "type": "object" - }, - { - "description": "Behavior", - "name": "Behavior", - "supplementaryInformation": "RollingCounter::RollingCounter", - "type": "behavior" } ], "objectGroups": [] @@ -9500,110 +9504,33 @@ "folderName": "__ROOT", "children": [ { - "functionName": "doStepPreEvents" - }, - { - "functionName": "Value" - }, - { - "functionName": "SetValue" + "functionName": "onCreated" }, { - "functionName": "ResetDisplayedValue" + "functionName": "doStepPostEvents" } ] }, "propertyDescriptors": [ { "value": "", - "type": "Behavior", - "label": "Text capability", - "extraInformation": [ - "TextContainerCapability::TextContainerBehavior" - ], - "choices": [], - "name": "Text" - }, - { - "value": "Score: ", - "type": "String", - "label": "Prefix", - "name": "Prefix" - }, - { - "value": "", - "type": "String", - "label": "Suffix", - "name": "Suffix" - }, - { - "value": "1", - "type": "Number", - "unit": "Second", - "label": "Animation duration", - "name": "Duration" - }, - { - "value": "1", - "type": "Number", - "unit": "Dimensionless", - "label": "Increment", - "name": "Increment" - }, - { - "value": "0", - "type": "Number", - "label": "", - "hidden": true, - "name": "CounterValue" - }, - { - "value": "0", - "type": "Number", - "label": "", - "hidden": true, - "name": "DisplayedValue" - }, - { - "value": "0", - "type": "Number", + "type": "Boolean", "label": "", "hidden": true, - "name": "Speed" + "name": "IsDragging" } ], "propertiesFolderStructure": { "folderName": "__ROOT", "children": [ { - "propertyName": "Text" - }, - { - "propertyName": "Prefix" - }, - { - "propertyName": "Suffix" - }, - { - "propertyName": "Duration" - }, - { - "propertyName": "Increment" - }, - { - "propertyName": "CounterValue" - }, - { - "propertyName": "DisplayedValue" - }, - { - "propertyName": "Speed" + "propertyName": "IsDragging" } ] - } + }, + "variants": [] } - ], - "eventsBasedObjects": [] + ] } ], "externalLayouts": [] From de3ec8591fef3bea6ad18595d6473da4c9d9a643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 7 May 2026 12:50:58 +0200 Subject: [PATCH 04/12] Add a property for the text --- examples/scrollbar/scrollbar.json | 212 ++++++++++++++++++++++++------ 1 file changed, 170 insertions(+), 42 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 75ef79366..cfdcb8f63 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -214,7 +214,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": false, - "zoomFactor": 0.5843784410740964, + "zoomFactor": 0.6672773998330016, "windowMask": false, "selectedLayer": "", "gameEditorMode": "instances-editor" @@ -697,7 +697,9 @@ "variables": [], "effects": [], "behaviors": [], - "content": {} + "content": { + "TextContent": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\n\nUt velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\nAliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet." + } } ], "objectsFolderStructure": { @@ -2308,20 +2310,9 @@ "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.", "version": "1.2.0", - "description": [ - "Move a camera by dragging the mouse (or touchscreen). ", - "", - "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)", - "- Select which directions the camera will move (vertical, horizontal, or both) ", - "- Select the layer that will be moved", - "", - "Tips:", - "- If no parameters are selected, the camera will move in both directions when the left mouse button (or touchscreen) are dragged." - ], + "description": "Move a camera by dragging the mouse (or touchscreen).", "origin": { "identifier": "DragCameraWithPointer", "name": "gdevelop-extension-store" @@ -2337,8 +2328,8 @@ "gestures" ], "authorIds": [ - "GfzRsieyUFVnsRR8OZThsPR29oq2", - "gqDaZjCfevOOxBYkK6zlhtZnXCg1" + "gqDaZjCfevOOxBYkK6zlhtZnXCg1", + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" ], "dependencies": [], "globalVariables": [], @@ -2690,7 +2681,7 @@ }, "eventsBasedBehaviors": [ { - "description": "", + "description": "Move a camera by dragging the mouse (or touchscreen).", "fullName": "Draggeable camera area", "helpPath": "", "iconUrl": "", @@ -3816,6 +3807,44 @@ } ], "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": "DragCameraWithPointer::DraggeableCameraArea", + "type": "behavior" + } + ], + "objectGroups": [] } ], "eventsFunctionsFolderStructure": { @@ -3838,6 +3867,9 @@ }, { "functionName": "SetTargetedCameraX" + }, + { + "functionName": "onDeActivate" } ] }, @@ -8846,17 +8878,17 @@ }, { "author": "", - "category": "", + "category": "User interface", "dimension": "", "extensionNamespace": "", - "fullName": "", + "fullName": "Scrollable text", "gdevelopVersion": "", "helpPath": "", - "iconUrl": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI4LDMwSDRjLTEuMSwwLTItMC45LTItMlY0YzAtMS4xLDAuOS0yLDItMmgyNGMxLjEsMCwyLDAuOSwyLDJ2MjRDMzAsMjkuMSwyOS4xLDMwLDI4LDMweiIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIwIiB5MT0iMiIgeDI9IjIwIiB5Mj0iMzAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI3LDI0IDI1LDI2IDIzLDI0ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjMsOCAyNSw2IDI3LDggIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iNiIgeTE9IjkiIHgyPSIxNiIgeTI9IjkiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI2IiB5MT0iMTMiIHgyPSIxMiIgeTI9IjEzIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iNiIgeTE9IjE3IiB4Mj0iMTIiIHkyPSIxNyIvPg0KPC9zdmc+DQo=", "name": "ScrollableText", - "previewIconUrl": "", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/0eeb1d19928934f1063c41710e713ba85b55e994d602c8f2d9a9e5a102df8c5e_Interface Elements_interface_ui_vertical_scroll_area_box_text.svg", "shortDescription": "", - "version": "", + "version": "1.0.0", "description": "", "tags": [], "authorIds": [], @@ -8881,6 +8913,7 @@ "fullName": "", "helpPath": "", "iconUrl": "", + "isTextContainer": true, "isUsingLegacyInstancesRenderer": false, "name": "ScrollableText", "previewIconUrl": "", @@ -8971,7 +9004,7 @@ "variables": [], "effects": [], "behaviors": [], - "string": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\n\nUt velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\nAliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.", + "string": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.", "font": "", "textAlignment": "left", "characterSize": 18, @@ -8994,7 +9027,7 @@ "shadowOpacity": 127, "smoothed": true, "underlined": false, - "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\n\nUt velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\nAliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet.", + "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.", "font": "", "textAlignment": "left", "verticalTextAlignment": "top", @@ -9085,6 +9118,26 @@ "effects": [], "behaviors": [], "content": {} + }, + { + "assetStoreId": "", + "name": "BitmapText", + "persistentUuid": "c37ed84c-ddbe-43df-9fbb-d83e3024cb5d", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "text": "This text use the default bitmap font.\nUse a custom Bitmap Font to create your own texts.", + "opacity": 255, + "scale": 1, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "", + "textureAtlasResourceName": "", + "align": "left", + "verticalTextAlignment": "top" + } } ], "objectsFolderStructure": { @@ -9096,6 +9149,9 @@ { "objectName": "Text" }, + { + "objectName": "BitmapText" + }, { "objectName": "ContentBackground" }, @@ -9116,6 +9172,20 @@ }, { "name": "ContentBackground" + }, + { + "name": "BitmapText" + } + ] + }, + { + "name": "Texts", + "objects": [ + { + "name": "Text" + }, + { + "name": "BitmapText" } ] } @@ -9298,7 +9368,7 @@ "angle": 0, "customSize": true, "depth": 1, - "height": 1093, + "height": 271, "keepRatio": true, "layer": "", "name": "Text", @@ -9315,7 +9385,7 @@ "angle": 0, "customSize": true, "depth": 1, - "height": 1156, + "height": 337, "keepRatio": true, "layer": "", "name": "ContentBackground", @@ -9341,7 +9411,7 @@ "gridColor": 10401023, "gridAlpha": 0.8, "snap": false, - "zoomFactor": 1.3993569068236673, + "zoomFactor": 1.2255083237054676, "windowMask": false, "selectedLayer": "", "gameEditorMode": "instances-editor" @@ -9353,6 +9423,45 @@ "name": "doStepPostEvents", "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Texts", + "Text", + "=", + "Object.Text::Value()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "ContentBackground", + "Resizable", + "=", + "Texts.Height() + 2 * (Texts.Y() - ContentBackground.Y())" + ] + }, + { + "type": { + "value": "Scrollbar::Scrollbar::SetContentLength" + }, + "parameters": [ + "ScrollBar", + "=", + "ContentBackground.Height()", + "" + ] + } + ] + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -9455,17 +9564,6 @@ "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::SetContentLength" - }, - "parameters": [ - "ScrollBar", - "=", - "ContentBackground.Height()", - "" - ] - }, { "type": { "value": "ShowLayer" @@ -9485,6 +9583,17 @@ "Mask", "" ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Object", + "Text", + "=", + "TextContent" + ] } ] } @@ -9514,17 +9623,36 @@ "propertyDescriptors": [ { "value": "", - "type": "Boolean", + "type": "MultilineString", + "label": "Text", + "name": "TextContent" + }, + { + "value": "", + "type": "Choice", "label": "", + "choices": [ + { + "label": "", + "value": "Text.Text=TextContent" + }, + { + "label": "", + "value": "BitmapText.Text=TextContent" + } + ], "hidden": true, - "name": "IsDragging" + "name": "_PropertyMapping" } ], "propertiesFolderStructure": { "folderName": "__ROOT", "children": [ { - "propertyName": "IsDragging" + "propertyName": "TextContent" + }, + { + "propertyName": "_PropertyMapping" } ] }, From a1232b58988424fd9caef7678dc5115809576762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 7 May 2026 13:21:38 +0200 Subject: [PATCH 05/12] Add anchors --- examples/scrollbar/scrollbar.json | 184 ++++++++++++++---------------- 1 file changed, 88 insertions(+), 96 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index cfdcb8f63..902c8ae9f 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -370,14 +370,13 @@ { "angle": 0, "customSize": false, - "height": 0, - "keepRatio": true, + "height": 338, "layer": "", "name": "NewScrollableText", "persistentUuid": "73913249-039a-458c-849e-a41b1e24972e", - "width": 0, - "x": 782, - "y": 265, + "width": 598, + "x": 712, + "y": 262, "zOrder": 14, "numberProperties": [], "stringProperties": [], @@ -8903,7 +8902,7 @@ "eventsBasedObjects": [ { "areaMaxX": 440, - "areaMaxY": 337, + "areaMaxY": 338, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, @@ -8913,85 +8912,12 @@ "fullName": "", "helpPath": "", "iconUrl": "", + "isInnerAreaFollowingParentSize": true, "isTextContainer": true, "isUsingLegacyInstancesRenderer": false, "name": "ScrollableText", "previewIconUrl": "", "objects": [ - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "NewSprite", - "persistentUuid": "5ad40ccf-893b-4420-a0c9-ce5a82afa7ca", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [] - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "ContentBackground", - "persistentUuid": "6f5d1b3d-7377-46e3-bac6-f77a71da6da2", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [], - "animations": [ - { - "name": "DarkGrey", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "metadata": "{\"pskl\":{}}", - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "LightGrey", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 0 - }, - { - "x": 64, - "y": 0 - }, - { - "x": 64, - "y": 64 - }, - { - "x": 0, - "y": 64 - } - ] - ] - } - ] - } - ] - } - ] - }, { "assetStoreId": "", "bold": false, @@ -9003,8 +8929,19 @@ "underlined": false, "variables": [], "effects": [], - "behaviors": [], - "string": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.", + "behaviors": [ + { + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.", "font": "", "textAlignment": "left", "characterSize": 18, @@ -9027,7 +8964,7 @@ "shadowOpacity": 127, "smoothed": true, "underlined": false, - "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.", + "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.", "font": "", "textAlignment": "left", "verticalTextAlignment": "top", @@ -9046,6 +8983,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + }, { "name": "DraggeableCameraArea", "type": "DragCameraWithPointer::DraggeableCameraArea", @@ -9116,7 +9063,18 @@ "variant": "Yellow rounded scroll bar", "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 2, + "name": "Anchor", + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "type": "AnchorBehavior::AnchorBehavior", + "useLegacyBottomAndRightAnchors": false + } + ], "content": {} }, { @@ -9126,7 +9084,18 @@ "type": "BitmapText::BitmapTextObject", "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 0, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], "content": { "text": "This text use the default bitmap font.\nUse a custom Bitmap Font to create your own texts.", "opacity": 255, @@ -9138,14 +9107,39 @@ "align": "left", "verticalTextAlignment": "top" } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "ContentBackground", + "persistentUuid": "73b38e51-3461-41eb-ba5a-7be4f49143b3", + "rightMargin": 0, + "texture": "LightGrey", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] } ], "objectsFolderStructure": { "folderName": "__ROOT", "children": [ - { - "objectName": "NewSprite" - }, { "objectName": "Text" }, @@ -9171,10 +9165,10 @@ "name": "Text" }, { - "name": "ContentBackground" + "name": "BitmapText" }, { - "name": "BitmapText" + "name": "ContentBackground" } ] }, @@ -9333,9 +9327,8 @@ { "angle": 0, "customSize": true, - "depth": 64, - "height": 337, - "keepRatio": true, + "depth": 64.18991097922849, + "height": 338, "layer": "UI", "name": "ScrollBar", "persistentUuid": "10e8cd1d-db62-4922-a779-5c0e5fb0ab3c", @@ -9385,11 +9378,10 @@ "angle": 0, "customSize": true, "depth": 1, - "height": 337, - "keepRatio": true, + "height": 338, "layer": "", "name": "ContentBackground", - "persistentUuid": "866bf29b-8a83-4b1b-988d-fc09559295d8", + "persistentUuid": "6638ee83-466d-4926-a1a3-028b0470c2fe", "width": 440, "x": 0, "y": 0, From baa35617bb1b7baecb6eddbaad53c42bf9e725a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 7 May 2026 13:30:28 +0200 Subject: [PATCH 06/12] Add descriptions --- examples/scrollbar/scrollbar.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 902c8ae9f..471dd0fd8 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -8886,9 +8886,9 @@ "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI4LDMwSDRjLTEuMSwwLTItMC45LTItMlY0YzAtMS4xLDAuOS0yLDItMmgyNGMxLjEsMCwyLDAuOSwyLDJ2MjRDMzAsMjkuMSwyOS4xLDMwLDI4LDMweiIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIwIiB5MT0iMiIgeDI9IjIwIiB5Mj0iMzAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI3LDI0IDI1LDI2IDIzLDI0ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjMsOCAyNSw2IDI3LDggIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iNiIgeTE9IjkiIHgyPSIxNiIgeTI9IjkiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI2IiB5MT0iMTMiIHgyPSIxMiIgeTI9IjEzIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iNiIgeTE9IjE3IiB4Mj0iMTIiIHkyPSIxNyIvPg0KPC9zdmc+DQo=", "name": "ScrollableText", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/0eeb1d19928934f1063c41710e713ba85b55e994d602c8f2d9a9e5a102df8c5e_Interface Elements_interface_ui_vertical_scroll_area_box_text.svg", - "shortDescription": "", + "shortDescription": "A text that can be scrolled with touch and a scrollbar.", "version": "1.0.0", - "description": "", + "description": "A text that can be scrolled with touch and a scrollbar.", "tags": [], "authorIds": [], "dependencies": [], @@ -8908,8 +8908,8 @@ "areaMinY": 0, "areaMinZ": 0, "defaultName": "", - "description": "", - "fullName": "", + "description": "Text that can be scrolled with touch and a scrollbar.", + "fullName": "Scrollable text", "helpPath": "", "iconUrl": "", "isInnerAreaFollowingParentSize": true, From feb0d53f7c0530d4a419aa87df78a928df250f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 7 May 2026 13:31:05 +0200 Subject: [PATCH 07/12] Remove the custom object instance --- examples/scrollbar/scrollbar.json | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 471dd0fd8..dcc36c03d 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -366,21 +366,6 @@ "numberProperties": [], "stringProperties": [], "initialVariables": [] - }, - { - "angle": 0, - "customSize": false, - "height": 338, - "layer": "", - "name": "NewScrollableText", - "persistentUuid": "73913249-039a-458c-849e-a41b1e24972e", - "width": 598, - "x": 712, - "y": 262, - "zOrder": 14, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] } ], "objects": [ @@ -713,9 +698,6 @@ { "objectName": "ContentBackground" }, - { - "objectName": "NewScrollableText" - }, { "objectName": "NoButton" }, @@ -730,6 +712,9 @@ }, { "objectName": "WinterBackground" + }, + { + "objectName": "NewScrollableText" } ] }, From 4caf58d700b35f722699c1ee8860165cb95c8255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Thu, 7 May 2026 19:11:23 +0200 Subject: [PATCH 08/12] Fix minimum height --- examples/scrollbar/scrollbar.json | 724 ++++++++++++++++++------------ 1 file changed, 436 insertions(+), 288 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index dcc36c03d..a7532fe24 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -1,7 +1,7 @@ { "firstLayout": "", "gdVersion": { - "build": 266, + "build": 268, "major": 5, "minor": 6, "revision": 0 @@ -605,7 +605,7 @@ "behaviors": [ { "name": "DraggeableCameraArea", - "type": "DragCameraWithPointer::DraggeableCameraArea", + "type": "DragCameraWithPointer::ScrollableViewport", "Direction": "Vertical", "IsDragged": false, "StartX": 9.788238970689376e-306, @@ -684,6 +684,19 @@ "content": { "TextContent": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\n\nUt velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\nAliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet." } + }, + { + "assetStoreId": "", + "name": "NewScrollableText3", + "persistentUuid": "5384246b-92ca-40dd-91d8-c2ff3712b229", + "type": "ScrollableText::ScrollableText", + "variant": "", + "variables": [], + "effects": [], + "behaviors": [], + "content": { + "TextContent": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor." + } } ], "objectsFolderStructure": { @@ -715,6 +728,9 @@ }, { "objectName": "NewScrollableText" + }, + { + "objectName": "NewScrollableText3" } ] }, @@ -1020,7 +1036,7 @@ }, { "name": "DraggeableCameraArea", - "type": "DragCameraWithPointer::DraggeableCameraArea" + "type": "DragCameraWithPointer::ScrollableViewport" }, { "name": "Effect", @@ -2665,11 +2681,11 @@ }, "eventsBasedBehaviors": [ { - "description": "Move a camera by dragging the mouse (or touchscreen).", - "fullName": "Draggeable camera area", + "description": "Move a camera by dragging or with the wheel.", + "fullName": "Scrollable viewport", "helpPath": "", "iconUrl": "", - "name": "DraggeableCameraArea", + "name": "ScrollableViewport", "objectType": "", "previewIconUrl": "", "eventsFunctions": [ @@ -3075,21 +3091,12 @@ "conditions": [ { "type": { - "value": "IsMouseWheelScrollingUp" - }, - "parameters": [ - "" - ] - }, - { - "type": { - "value": "IsCursorOnObject" + "value": "NumberVariable" }, "parameters": [ - "Object", - "", - "", - "" + "WheelStepSize", + "!=", + "0" ] } ], @@ -3100,165 +3107,118 @@ "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": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + "value": "IsMouseWheelScrollingUp" }, "parameters": [ - "Object", - "Behavior", - "-", - "WheelStepSize", "" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Else", - "conditions": [], - "actions": [ + }, { "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraY" + "value": "IsCursorOnObject" }, "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": [ + "actions": [], + "events": [ { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "State", - "=", - "\"Wheeled\"" + "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": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedCameraX", - "=", - "CameraCenterX(Layer)" + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Direction", + "=", + "\"Horizontal\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraX" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "WheelStepSize", + "" + ] + } ] }, { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "TargetedCameraY", - "=", - "CameraCenterY(Layer)" + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ + { + "type": { + "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraY" + }, + "parameters": [ + "Object", + "Behavior", + "-", + "WheelStepSize", + "" + ] + } ] } ] @@ -3268,130 +3228,116 @@ "conditions": [ { "type": { - "value": "StringVariable" - }, - "parameters": [ - "Direction", - "=", - "\"Horizontal\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraX" + "value": "IsMouseWheelScrollingDown" }, "parameters": [ - "Object", - "Behavior", - "+", - "WheelStepSize", "" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Else", - "conditions": [], - "actions": [ + }, { "type": { - "value": "DragCameraWithPointer::DraggeableCameraArea::SetTargetedCameraY" + "value": "IsCursorOnObject" }, "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", + "", "" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "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": [ - "sign(SpeedX)", + "Direction", "=", - "sign(CameraCenterX(Layer) - TargetedCameraX)" + "\"Horizontal\"" ] } ], "actions": [ { "type": { - "value": "SetCameraCenterX" + "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraX" }, "parameters": [ - "", - "=", - "TargetedCameraX", - "Layer", + "Object", + "Behavior", + "+", + "WheelStepSize", "" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Else", + "conditions": [], + "actions": [ { "type": { - "value": "SetNumberVariable" + "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraY" }, "parameters": [ - "SpeedX", - "=", - "0" + "Object", + "Behavior", + "+", + "WheelStepSize", + "" ] } ] @@ -3403,67 +3349,155 @@ "conditions": [ { "type": { - "value": "NumberVariable" - }, - "parameters": [ - "SpeedY", - "!=", - "0" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraCenterY" + "value": "StringVariable" }, "parameters": [ - "", - "+", - "SpeedY * TimeDelta()", - "Layer", - "" + "State", + "=", + "\"Wheeled\"" ] } ], + "actions": [], "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" + "value": "NumberVariable" }, "parameters": [ - "sign(SpeedY)", - "=", - "sign(CameraCenterY(Layer) - TargetedCameraY)" + "SpeedX", + "!=", + "0" ] } ], "actions": [ { "type": { - "value": "SetCameraCenterY" + "value": "SetCameraCenterX" }, "parameters": [ "", - "=", - "TargetedCameraY", + "+", + "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": "SetNumberVariable" + "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" + ] + } + ] + } ] } ] @@ -3556,7 +3590,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", "type": "behavior" } ], @@ -3604,7 +3638,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", "type": "behavior" } ], @@ -3645,7 +3679,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", "type": "behavior" } ], @@ -3695,7 +3729,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", "type": "behavior" } ], @@ -3736,7 +3770,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", "type": "behavior" } ], @@ -3786,7 +3820,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", "type": "behavior" } ], @@ -3824,7 +3858,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::DraggeableCameraArea", + "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", "type": "behavior" } ], @@ -8916,13 +8950,13 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 0, "leftEdgeAnchor": 1, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 2, "topEdgeAnchor": 0, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false } ], @@ -8969,18 +9003,18 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 2, "leftEdgeAnchor": 1, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 2, "topEdgeAnchor": 1, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false }, { "name": "DraggeableCameraArea", - "type": "DragCameraWithPointer::DraggeableCameraArea", + "type": "DragCameraWithPointer::ScrollableViewport", "Direction": "Vertical", "IsDragged": false, "StartX": 1.888759594395442e-306, @@ -9050,13 +9084,13 @@ "effects": [], "behaviors": [ { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", "bottomEdgeAnchor": 2, "leftEdgeAnchor": 2, - "name": "Anchor", "relativeToOriginalWindowSize": true, "rightEdgeAnchor": 2, "topEdgeAnchor": 1, - "type": "AnchorBehavior::AnchorBehavior", "useLegacyBottomAndRightAnchors": false } ], @@ -9423,7 +9457,7 @@ "ContentBackground", "Resizable", "=", - "Texts.Height() + 2 * (Texts.Y() - ContentBackground.Y())" + "max(Object.Height(), Texts.Height() + 2 * (Texts.Y() - ContentBackground.Y()))" ] }, { @@ -9584,6 +9618,111 @@ } ], "objectGroups": [] + }, + { + "description": "the top position of the displayed part.", + "fullName": "Scroll position", + "functionType": "ExpressionAndCondition", + "name": "ScrollPosition", + "sentence": "the scroll position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ScrollBar.ScrollPosition()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScrollPosition", + "name": "SetScrollPosition", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "ScrollBar", + "=", + "Value", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the length of the content to scroll.", + "fullName": "Content length", + "functionType": "ExpressionAndCondition", + "name": "ContentLength", + "sentence": "the content length", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ScrollBar.ContentLength()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "ScrollableText::ScrollableText", + "type": "object" + } + ], + "objectGroups": [] } ], "eventsFunctionsFolderStructure": { @@ -9594,6 +9733,15 @@ }, { "functionName": "doStepPostEvents" + }, + { + "functionName": "ScrollPosition" + }, + { + "functionName": "SetScrollPosition" + }, + { + "functionName": "ContentLength" } ] }, From c34f9507b9cbfec78fb677faf953870e7aa0b256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 16:28:00 +0200 Subject: [PATCH 09/12] Improve descriptions --- examples/scrollbar/scrollbar.json | 321 +++--------------------------- 1 file changed, 32 insertions(+), 289 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index a7532fe24..0334e6195 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -1,7 +1,7 @@ { "firstLayout": "", "gdVersion": { - "build": 268, + "build": 269, "major": 5, "minor": 6, "revision": 0 @@ -605,7 +605,7 @@ "behaviors": [ { "name": "DraggeableCameraArea", - "type": "DragCameraWithPointer::ScrollableViewport", + "type": "ScrollableViewport::ScrollableViewport", "Direction": "Vertical", "IsDragged": false, "StartX": 9.788238970689376e-306, @@ -1036,7 +1036,7 @@ }, { "name": "DraggeableCameraArea", - "type": "DragCameraWithPointer::ScrollableViewport" + "type": "ScrollableViewport::ScrollableViewport" }, { "name": "Effect", @@ -2304,19 +2304,21 @@ "category": "Camera", "dimension": "2D", "extensionNamespace": "", - "fullName": "Drag camera with the mouse (or touchscreen)", + "fullName": "Scrollable viewport", "gdevelopVersion": ">=5.5.222", "helpPath": "", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRyYWctdmFyaWFudCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0yMi42NywxMkwxOC4xOCwxNi41TDE1LjY3LDE0TDE3LjY1LDEyTDE1LjY3LDEwLjA0TDE4LjE4LDcuNTNMMjIuNjcsMTJNMTIsMS4zM0wxNi40Nyw1LjgyTDEzLjk2LDguMzNMMTIsNi4zNUwxMCw4LjMzTDcuNSw1LjgyTDEyLDEuMzNNMTIsMjIuNjdMNy41MywxOC4xOEwxMC4wNCwxNS42N0wxMiwxNy42NUwxNCwxNS42N0wxNi41LDE4LjE4TDEyLDIyLjY3TTEuMzMsMTJMNS44Miw3LjVMOC4zMywxMEw2LjM1LDEyTDguMzMsMTMuOTZMNS44MiwxNi40N0wxLjMzLDEyTTEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyQTIsMiAwIDAsMSAxMiwxMFoiIC8+PC9zdmc+", - "name": "DragCameraWithPointer", + "name": "ScrollableViewport", "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/drag-variant.svg", - "shortDescription": "Pan/drag camera with mouse or touch.", - "version": "1.2.0", - "description": "Move a camera by dragging the mouse (or touchscreen).", - "origin": { - "identifier": "DragCameraWithPointer", - "name": "gdevelop-extension-store" - }, + "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", @@ -2329,266 +2331,13 @@ ], "authorIds": [ "gqDaZjCfevOOxBYkK6zlhtZnXCg1", - "IWykYNRvhCZBN3vEgKEbBPOR3Oc2" + "IWykYNRvhCZBN3vEgKEbBPOR3Oc2", + "GfzRsieyUFVnsRR8OZThsPR29oq2" ], "dependencies": [], "globalVariables": [], - "sceneVariables": [ - { - "name": "ScrollStartX", - "type": "number", - "value": 0 - }, - { - "name": "ScrollStartY", - "type": "number", - "value": 0 - }, - { - "name": "IsCameraDragged", - "type": "boolean", - "value": false - } - ], + "sceneVariables": [], "eventsFunctions": [ - { - "description": "Move a camera by dragging the mouse (or touchscreen).", - "fullName": "Drag camera with the mouse", - "functionType": "Action", - "name": "DragCameraWithPointer", - "sentence": "Drag camera on layer _PARAM2_ in _PARAM3_ directions using _PARAM4_ mouse button", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsCameraDragged", - "False", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "MouseButtonFromTextPressed" - }, - "parameters": [ - "", - "InputButton" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::And" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "InputButton", - "=", - "\"\"" - ] - }, - { - "type": { - "value": "MouseButtonFromTextPressed" - }, - "parameters": [ - "", - "\"Left\"" - ] - } - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetBooleanVariable" - }, - "parameters": [ - "IsCameraDragged", - "True", - "" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ScrollStartX", - "=", - "CursorX(Layer, Camera)" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ScrollStartY", - "=", - "CursorY(Layer, Camera)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Direction", - "!=", - "\"vertical\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraCenterX" - }, - "parameters": [ - "", - "-", - "CursorX(Layer, Camera) - ScrollStartX", - "Layer", - "Camera" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "StringVariable" - }, - "parameters": [ - "Direction", - "!=", - "\"horizontal\"" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetCameraCenterY" - }, - "parameters": [ - "", - "-", - "CursorY(Layer, Camera) - ScrollStartY", - "Layer", - "Camera" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Camera number (default: 0)", - "name": "Camera", - "type": "expression" - }, - { - "description": "Camera layer (default: \"\")", - "name": "Layer", - "type": "layer" - }, - { - "description": "Directions that the camera can move (horizontal, vertical, both)", - "name": "Direction", - "supplementaryInformation": "[\"vertical\",\"horizontal\",\"both\"]", - "type": "stringWithSelector" - }, - { - "description": "Mouse button (use \"Left\" for touchscreen)", - "name": "InputButton", - "type": "mouse" - } - ], - "objectGroups": [] - }, - { - "fullName": "Camera is dragged", - "functionType": "Condition", - "name": "IsCameraDragged", - "sentence": "Layer camera is dragged", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "IsCameraDragged", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [], - "objectGroups": [] - }, { "fullName": "", "functionType": "Expression", @@ -2668,12 +2417,6 @@ "eventsFunctionsFolderStructure": { "folderName": "__ROOT", "children": [ - { - "functionName": "DragCameraWithPointer" - }, - { - "functionName": "IsCameraDragged" - }, { "functionName": "MoveToZero" } @@ -2681,7 +2424,7 @@ }, "eventsBasedBehaviors": [ { - "description": "Move a camera by dragging or with the wheel.", + "description": "Move a camera by dragging or with the scroll wheel.", "fullName": "Scrollable viewport", "helpPath": "", "iconUrl": "", @@ -3028,7 +2771,7 @@ "parameters": [ "SpeedX", "=", - "DragCameraWithPointer::MoveToZero(SpeedX, InertiaDeceleration * TimeDelta())" + "ScrollableViewport::MoveToZero(SpeedX, InertiaDeceleration * TimeDelta())" ] } ] @@ -3067,7 +2810,7 @@ "parameters": [ "SpeedY", "=", - "DragCameraWithPointer::MoveToZero(SpeedY, InertiaDeceleration * TimeDelta())" + "ScrollableViewport::MoveToZero(SpeedY, InertiaDeceleration * TimeDelta())" ] } ] @@ -3191,7 +2934,7 @@ "actions": [ { "type": { - "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraX" + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraX" }, "parameters": [ "Object", @@ -3209,7 +2952,7 @@ "actions": [ { "type": { - "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraY" + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraY" }, "parameters": [ "Object", @@ -3312,7 +3055,7 @@ "actions": [ { "type": { - "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraX" + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraX" }, "parameters": [ "Object", @@ -3330,7 +3073,7 @@ "actions": [ { "type": { - "value": "DragCameraWithPointer::ScrollableViewport::SetTargetedCameraY" + "value": "ScrollableViewport::ScrollableViewport::SetTargetedCameraY" }, "parameters": [ "Object", @@ -3590,7 +3333,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", "type": "behavior" } ], @@ -3638,7 +3381,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", "type": "behavior" } ], @@ -3679,7 +3422,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", "type": "behavior" } ], @@ -3729,7 +3472,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", "type": "behavior" } ], @@ -3770,7 +3513,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", "type": "behavior" } ], @@ -3820,7 +3563,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", "type": "behavior" } ], @@ -3858,7 +3601,7 @@ { "description": "Behavior", "name": "Behavior", - "supplementaryInformation": "DragCameraWithPointer::ScrollableViewport", + "supplementaryInformation": "ScrollableViewport::ScrollableViewport", "type": "behavior" } ], @@ -9014,7 +8757,7 @@ }, { "name": "DraggeableCameraArea", - "type": "DragCameraWithPointer::ScrollableViewport", + "type": "ScrollableViewport::ScrollableViewport", "Direction": "Vertical", "IsDragged": false, "StartX": 1.888759594395442e-306, From ce301af4e484008ec6f2ab1bb17c1772531b6e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 16:31:05 +0200 Subject: [PATCH 10/12] Fix behavior name --- examples/scrollbar/scrollbar.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 0334e6195..858dc790e 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -604,7 +604,7 @@ "effects": [], "behaviors": [ { - "name": "DraggeableCameraArea", + "name": "ScrollableViewport", "type": "ScrollableViewport::ScrollableViewport", "Direction": "Vertical", "IsDragged": false, @@ -804,7 +804,7 @@ }, "parameters": [ "Mask", - "DraggeableCameraArea", + "ScrollableViewport", "yes" ] } @@ -830,7 +830,7 @@ }, "parameters": [ "Mask", - "DraggeableCameraArea", + "ScrollableViewport", "no" ] } @@ -1034,10 +1034,6 @@ "name": "Animation", "type": "AnimatableCapability::AnimatableBehavior" }, - { - "name": "DraggeableCameraArea", - "type": "ScrollableViewport::ScrollableViewport" - }, { "name": "Effect", "type": "EffectCapability::EffectBehavior" @@ -1058,6 +1054,10 @@ "name": "Scale", "type": "ScalableCapability::ScalableBehavior" }, + { + "name": "ScrollableViewport", + "type": "ScrollableViewport::ScrollableViewport" + }, { "name": "Text", "type": "TextContainerCapability::TextContainerBehavior" @@ -8756,7 +8756,7 @@ "useLegacyBottomAndRightAnchors": false }, { - "name": "DraggeableCameraArea", + "name": "ScrollableViewport", "type": "ScrollableViewport::ScrollableViewport", "Direction": "Vertical", "IsDragged": false, @@ -9248,7 +9248,7 @@ }, "parameters": [ "Mask", - "DraggeableCameraArea", + "ScrollableViewport", "yes" ] } @@ -9274,7 +9274,7 @@ }, "parameters": [ "Mask", - "DraggeableCameraArea", + "ScrollableViewport", "no" ] } From 1ac1b2ae130109cb6f5d74243291f1089a88b813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 16:35:07 +0200 Subject: [PATCH 11/12] Fix object order --- examples/scrollbar/scrollbar.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 858dc790e..6c87824f5 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -712,16 +712,16 @@ "objectName": "ContentBackground" }, { - "objectName": "NoButton" + "objectName": "Mask" }, { "objectName": "YesButton" }, { - "objectName": "ButtonBackground" + "objectName": "NoButton" }, { - "objectName": "Mask" + "objectName": "ButtonBackground" }, { "objectName": "WinterBackground" From 91644b165d1dd9208af772b29d07d3158f8a6774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 8 May 2026 16:36:47 +0200 Subject: [PATCH 12/12] Remove the custom object --- examples/scrollbar/scrollbar.json | 923 ------------------------------ 1 file changed, 923 deletions(-) diff --git a/examples/scrollbar/scrollbar.json b/examples/scrollbar/scrollbar.json index 6c87824f5..5a531cd83 100644 --- a/examples/scrollbar/scrollbar.json +++ b/examples/scrollbar/scrollbar.json @@ -671,32 +671,6 @@ ] } ] - }, - { - "assetStoreId": "", - "name": "NewScrollableText", - "persistentUuid": "a325f0bc-13bc-451a-b5bf-4dafe29ce287", - "type": "ScrollableText::ScrollableText", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "TextContent": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat. Duis semper. Duis arcu massa, scelerisque vitae, consequat in, pretium a, enim. Pellentesque congue. Ut in risus volutpat libero pharetra tempor. Cras vestibulum bibendum augue. Praesent egestas leo in pede. Praesent blandit odio eu enim. Pellentesque sed dui ut augue blandit sodales. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam nibh. Mauris ac mauris sed pede pellentesque fermentum. Maecenas adipiscing ante non diam sodales hendrerit.\n\nUt velit mauris, egestas sed, gravida nec, ornare ut, mi. Aenean ut orci vel massa suscipit pulvinar. Nulla sollicitudin. Fusce varius, ligula non tempus aliquam, nunc turpis ullamcorper nibh, in tempus sapien eros vitae ligula. Pellentesque rhoncus nunc et augue. Integer id felis. Curabitur aliquet pellentesque diam. Integer quis metus vitae elit lobortis egestas. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi vel erat non mauris convallis vehicula. Nulla et sapien. Integer tortor tellus, aliquam faucibus, convallis id, congue eu, quam. Mauris ullamcorper felis vitae erat. Proin feugiat, augue non elementum posuere, metus purus iaculis lectus, et tristique ligula justo vitae magna.\nAliquam convallis sollicitudin purus. Praesent aliquam, enim at fermentum mollis, ligula massa adipiscing nisl, ac euismod nibh nisl eu lectus. Fusce vulputate sem at sapien. Vivamus leo. Aliquam euismod libero eu enim. Nulla nec felis sed leo placerat imperdiet. Aenean suscipit nulla in justo. Suspendisse cursus rutrum augue. Nulla tincidunt tincidunt mi. Curabitur iaculis, lorem vel rhoncus faucibus, felis magna fermentum augue, et ultricies lacus lorem varius purus. Curabitur eu amet." - } - }, - { - "assetStoreId": "", - "name": "NewScrollableText3", - "persistentUuid": "5384246b-92ca-40dd-91d8-c2ff3712b229", - "type": "ScrollableText::ScrollableText", - "variant": "", - "variables": [], - "effects": [], - "behaviors": [], - "content": { - "TextContent": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor." - } } ], "objectsFolderStructure": { @@ -725,12 +699,6 @@ }, { "objectName": "WinterBackground" - }, - { - "objectName": "NewScrollableText" - }, - { - "objectName": "NewScrollableText3" } ] }, @@ -8636,897 +8604,6 @@ }, "eventsBasedBehaviors": [], "eventsBasedObjects": [] - }, - { - "author": "", - "category": "User interface", - "dimension": "", - "extensionNamespace": "", - "fullName": "Scrollable text", - "gdevelopVersion": "", - "helpPath": "", - "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI4LDMwSDRjLTEuMSwwLTItMC45LTItMlY0YzAtMS4xLDAuOS0yLDItMmgyNGMxLjEsMCwyLDAuOSwyLDJ2MjRDMzAsMjkuMSwyOS4xLDMwLDI4LDMweiIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIwIiB5MT0iMiIgeDI9IjIwIiB5Mj0iMzAiLz4NCjxwb2x5bGluZSBjbGFzcz0ic3QwIiBwb2ludHM9IjI3LDI0IDI1LDI2IDIzLDI0ICIvPg0KPHBvbHlsaW5lIGNsYXNzPSJzdDAiIHBvaW50cz0iMjMsOCAyNSw2IDI3LDggIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iNiIgeTE9IjkiIHgyPSIxNiIgeTI9IjkiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI2IiB5MT0iMTMiIHgyPSIxMiIgeTI9IjEzIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iNiIgeTE9IjE3IiB4Mj0iMTIiIHkyPSIxNyIvPg0KPC9zdmc+DQo=", - "name": "ScrollableText", - "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/0eeb1d19928934f1063c41710e713ba85b55e994d602c8f2d9a9e5a102df8c5e_Interface Elements_interface_ui_vertical_scroll_area_box_text.svg", - "shortDescription": "A text that can be scrolled with touch and a scrollbar.", - "version": "1.0.0", - "description": "A text that can be scrolled with touch and a scrollbar.", - "tags": [], - "authorIds": [], - "dependencies": [], - "globalVariables": [], - "sceneVariables": [], - "eventsFunctions": [], - "eventsFunctionsFolderStructure": { - "folderName": "__ROOT" - }, - "eventsBasedBehaviors": [], - "eventsBasedObjects": [ - { - "areaMaxX": 440, - "areaMaxY": 338, - "areaMaxZ": 64, - "areaMinX": 0, - "areaMinY": 0, - "areaMinZ": 0, - "defaultName": "", - "description": "Text that can be scrolled with touch and a scrollbar.", - "fullName": "Scrollable text", - "helpPath": "", - "iconUrl": "", - "isInnerAreaFollowingParentSize": true, - "isTextContainer": true, - "isUsingLegacyInstancesRenderer": false, - "name": "ScrollableText", - "previewIconUrl": "", - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Text", - "persistentUuid": "eb367917-799f-4de5-8af3-ea8368a9d9a1", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "string": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.", - "font": "", - "textAlignment": "left", - "characterSize": 18, - "color": { - "b": 29, - "g": 29, - "r": 29 - }, - "content": { - "bold": false, - "isOutlineEnabled": false, - "isShadowEnabled": false, - "italic": false, - "outlineColor": "255;255;255", - "outlineThickness": 2, - "shadowAngle": 90, - "shadowBlurRadius": 2, - "shadowColor": "0;0;0", - "shadowDistance": 4, - "shadowOpacity": 127, - "smoothed": true, - "underlined": false, - "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor.", - "font": "", - "textAlignment": "left", - "verticalTextAlignment": "top", - "characterSize": 18, - "lineHeight": 0, - "color": "29;29;29" - } - }, - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "Mask", - "persistentUuid": "3f200499-d561-41f6-8b4c-e3408196fa81", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - }, - { - "name": "ScrollableViewport", - "type": "ScrollableViewport::ScrollableViewport", - "Direction": "Vertical", - "IsDragged": false, - "StartX": 1.888759594395442e-306, - "StartY": 1.8887595943967276e-306, - "Layer": "" - } - ], - "animations": [ - { - "name": "White", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "metadata": "{\"pskl\":{}}", - "timeBetweenFrames": 0.08, - "sprites": [ - { - "hasCustomCollisionMask": true, - "image": "White", - "points": [], - "originPoint": { - "name": "origine", - "x": 0, - "y": 0 - }, - "centerPoint": { - "automatic": true, - "name": "centre", - "x": 0, - "y": 0 - }, - "customCollisionMask": [ - [ - { - "x": 0, - "y": 0 - }, - { - "x": 64, - "y": 0 - }, - { - "x": 64, - "y": 64 - }, - { - "x": 0, - "y": 64 - } - ] - ] - } - ] - } - ] - } - ] - }, - { - "assetStoreId": "3b67abad485f3a4dee6271e8cdc41aee5e3f9da58939aeae39ad9dbd67e7140b", - "name": "ScrollBar", - "persistentUuid": "08ab7079-c9a0-4043-a084-785b97413bce", - "type": "Scrollbar::Scrollbar", - "variant": "Yellow rounded scroll bar", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 2, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": {} - }, - { - "assetStoreId": "", - "name": "BitmapText", - "persistentUuid": "c37ed84c-ddbe-43df-9fbb-d83e3024cb5d", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 0, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "text": "This text use the default bitmap font.\nUse a custom Bitmap Font to create your own texts.", - "opacity": 255, - "scale": 1, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "", - "textureAtlasResourceName": "", - "align": "left", - "verticalTextAlignment": "top" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "ContentBackground", - "persistentUuid": "73b38e51-3461-41eb-ba5a-7be4f49143b3", - "rightMargin": 0, - "texture": "LightGrey", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Text" - }, - { - "objectName": "BitmapText" - }, - { - "objectName": "ContentBackground" - }, - { - "objectName": "ScrollBar" - }, - { - "objectName": "Mask" - } - ] - }, - "objectsGroups": [ - { - "name": "Content", - "objects": [ - { - "name": "Text" - }, - { - "name": "BitmapText" - }, - { - "name": "ContentBackground" - } - ] - }, - { - "name": "Texts", - "objects": [ - { - "name": "Text" - }, - { - "name": "BitmapText" - } - ] - } - ], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ - { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 - } - ], - "effects": [] - }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "UI", - "renderingType": "", - "visibility": true, - "cameras": [], - "effects": [ - { - "effectType": "Scene3D::HemisphereLight", - "name": "3D Ambient Hemisphere Light", - "doubleParameters": { - "elevation": 40, - "intensity": 0.33, - "rotation": 300 - }, - "stringParameters": { - "groundColor": "127;127;127", - "skyColor": "255;255;255", - "top": "Z+" - }, - "booleanParameters": {} - }, - { - "effectType": "Scene3D::DirectionalLight", - "name": "3D Sun Light", - "doubleParameters": { - "distanceFromCamera": 1500, - "elevation": 40, - "frustumSize": 4000, - "intensity": 0.75, - "minimumShadowBias": 0, - "rotation": 300 - }, - "stringParameters": { - "color": "255;255;255", - "shadowQuality": "medium", - "top": "Z+" - }, - "booleanParameters": { - "isCastingShadow": true - } - } - ] - }, - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera2DPlaneMaxDrawingDistance": 5000, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "Mask", - "renderingType": "", - "visibility": false, - "cameras": [], - "effects": [ - { - "effectType": "Scene3D::HemisphereLight", - "name": "3D Ambient Hemisphere Light", - "doubleParameters": { - "elevation": 40, - "intensity": 0.33, - "rotation": 300 - }, - "stringParameters": { - "groundColor": "127;127;127", - "skyColor": "255;255;255", - "top": "Z+" - }, - "booleanParameters": {} - }, - { - "effectType": "Scene3D::DirectionalLight", - "name": "3D Sun Light", - "doubleParameters": { - "distanceFromCamera": 1500, - "elevation": 40, - "frustumSize": 4000, - "intensity": 0.75, - "minimumShadowBias": 0, - "rotation": 300 - }, - "stringParameters": { - "color": "255;255;255", - "shadowQuality": "medium", - "top": "Z+" - }, - "booleanParameters": { - "isCastingShadow": true - } - } - ] - } - ], - "instances": [ - { - "angle": 0, - "customSize": true, - "depth": 64.18991097922849, - "height": 338, - "layer": "UI", - "name": "ScrollBar", - "persistentUuid": "10e8cd1d-db62-4922-a779-5c0e5fb0ab3c", - "width": 24, - "x": 416, - "y": 0, - "zOrder": 4, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 337, - "keepRatio": true, - "layer": "Mask", - "name": "Mask", - "persistentUuid": "6f2ea7a4-9811-49cd-9c1c-da0c30e6e71b", - "width": 440, - "x": 0, - "y": 0, - "zOrder": 0, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 271, - "keepRatio": true, - "layer": "", - "name": "Text", - "persistentUuid": "9390cb66-ff7c-4880-a43f-970dc70f736b", - "width": 353, - "x": 34, - "y": 32, - "zOrder": 2, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - }, - { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 338, - "layer": "", - "name": "ContentBackground", - "persistentUuid": "6638ee83-466d-4926-a1a3-028b0470c2fe", - "width": 440, - "x": 0, - "y": 0, - "zOrder": 1, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] - } - ], - "editionSettings": { - "grid": false, - "gridType": "rectangular", - "gridWidth": 32, - "gridHeight": 32, - "gridDepth": 32, - "gridOffsetX": 0, - "gridOffsetY": 0, - "gridOffsetZ": 0, - "gridColor": 10401023, - "gridAlpha": 0.8, - "snap": false, - "zoomFactor": 1.2255083237054676, - "windowMask": false, - "selectedLayer": "", - "gameEditorMode": "instances-editor" - }, - "eventsFunctions": [ - { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Texts", - "Text", - "=", - "Object.Text::Value()" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "ContentBackground", - "Resizable", - "=", - "max(Object.Height(), Texts.Height() + 2 * (Texts.Y() - ContentBackground.Y()))" - ] - }, - { - "type": { - "value": "Scrollbar::Scrollbar::SetContentLength" - }, - "parameters": [ - "ScrollBar", - "=", - "ContentBackground.Height()", - "" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "Scrollbar::Scrollbar::IsThumbDragged" - }, - "parameters": [ - "ScrollBar", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Scrollbar::SetPositionFromCamera" - }, - "parameters": [ - "", - "ScrollBar", - "", - "" - ] - }, - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Mask", - "ScrollableViewport", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::IsThumbDragged" - }, - "parameters": [ - "ScrollBar", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "ActivateBehavior" - }, - "parameters": [ - "Mask", - "ScrollableViewport", - "no" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Scrollbar::SetCameraFromPosition" - }, - "parameters": [ - "", - "ScrollBar", - "\"\"", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "ShowLayer" - }, - "parameters": [ - "", - "\"Mask\"" - ] - }, - { - "type": { - "value": "SpriteMasking::Mask" - }, - "parameters": [ - "", - "Content", - "Mask", - "" - ] - }, - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Object", - "Text", - "=", - "TextContent" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the top position of the displayed part.", - "fullName": "Scroll position", - "functionType": "ExpressionAndCondition", - "name": "ScrollPosition", - "sentence": "the scroll position", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "ScrollBar.ScrollPosition()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ScrollPosition", - "name": "SetScrollPosition", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Scrollbar::Scrollbar::SetScrollPosition" - }, - "parameters": [ - "ScrollBar", - "=", - "Value", - "" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the length of the content to scroll.", - "fullName": "Content length", - "functionType": "ExpressionAndCondition", - "name": "ContentLength", - "sentence": "the content length", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "ScrollBar.ContentLength()" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "ScrollableText::ScrollableText", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "eventsFunctionsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "functionName": "onCreated" - }, - { - "functionName": "doStepPostEvents" - }, - { - "functionName": "ScrollPosition" - }, - { - "functionName": "SetScrollPosition" - }, - { - "functionName": "ContentLength" - } - ] - }, - "propertyDescriptors": [ - { - "value": "", - "type": "MultilineString", - "label": "Text", - "name": "TextContent" - }, - { - "value": "", - "type": "Choice", - "label": "", - "choices": [ - { - "label": "", - "value": "Text.Text=TextContent" - }, - { - "label": "", - "value": "BitmapText.Text=TextContent" - } - ], - "hidden": true, - "name": "_PropertyMapping" - } - ], - "propertiesFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "propertyName": "TextContent" - }, - { - "propertyName": "_PropertyMapping" - } - ] - }, - "variants": [] - } - ] } ], "externalLayouts": []