diff --git a/extensions/community/Scrollbar.json b/extensions/community/Scrollbar.json index 93510c2a0..dd6404036 100644 --- a/extensions/community/Scrollbar.json +++ b/extensions/community/Scrollbar.json @@ -1,6 +1,7 @@ { "author": "", "category": "User interface", + "dimension": "2D", "extensionNamespace": "", "fullName": "Scrollbar", "gdevelopVersion": "", @@ -9,11 +10,16 @@ "name": "Scrollbar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/c1313ac0735bd1c08d7327fd9a56b4d8cebf1b343f9ba82f1b141358433e1cdb_Interface Elements_interface_ui_scroll_bar_scrollbar.svg", "shortDescription": "A scrollbar to help making a scroll view.", - "version": "1.0.0", + "version": "1.0.1", "description": [ "A scrollbar to help making a scroll view.", "", - "An example of scroll view can be found in the [multiplayer custom lobbies](https://wiki.gdevelop.io/gdevelop5/extensions/multiplayer-custom-lobbies/) extension."], + "An example of scroll view can be found in the [multiplayer custom lobbies](https://wiki.gdevelop.io/gdevelop5/extensions/multiplayer-custom-lobbies/) extension." + ], + "origin": { + "identifier": "Scrollbar", + "name": "gdevelop-extension-store" + }, "tags": [ "scroll", "bar" @@ -27,6 +33,9 @@ "globalVariables": [], "sceneVariables": [], "eventsFunctions": [], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT" + }, "eventsBasedBehaviors": [], "eventsBasedObjects": [ { @@ -40,9 +49,12 @@ "defaultName": "", "description": "A scrollbar to help making a scroll view.", "fullName": "Scrollbar", + "helpPath": "", + "iconUrl": "", "isInnerAreaFollowingParentSize": true, "isUsingLegacyInstancesRenderer": false, "name": "Scrollbar", + "previewIconUrl": "", "objects": [ { "assetStoreId": "", @@ -127,6 +139,7 @@ "ambientLightColorB": 200, "ambientLightColorG": 200, "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, "camera3DFarPlaneDistance": 10000, "camera3DFieldOfView": 45, "camera3DNearPlaneDistance": 3, @@ -186,6 +199,7 @@ "initialVariables": [] } ], + "editionSettings": [], "eventsFunctions": [ { "fullName": "", @@ -453,7 +467,7 @@ "parameters": [ "Object", "=", - "(Thumb.Y() - Background.Y()) * ContentLength / Background.Height()", + "(Thumb.Y() - Background.Y()) * (ContentLength - Background.Height()) / (Background.Height() - Thumb.Height())", "" ] } @@ -550,7 +564,7 @@ "parameters": [ "Thumb", "=", - "clamp(Background.Y(), Background.Y() + Background.Height(), Background.Y() + ScrollPosition * Background.Height() / ContentLength)" + "clamp(Background.Y(), Background.Y() + Background.Height() - Thumb.Height(), Background.Y() + ScrollPosition * (Background.Height() - Thumb.Height()) / (ContentLength - Background.Height()))" ] } ] @@ -567,11 +581,12 @@ "objectGroups": [] }, { - "description": "the scroll position.", - "fullName": "Scroll position", + "description": "the top position of the displayed part.", + "fullName": "Scroll top position", "functionType": "ExpressionAndCondition", "name": "ScrollPosition", - "sentence": "the scroll position", + "private": true, + "sentence": "the scroll top position", "events": [ { "type": "BuiltinCommonInstructions::Standard", @@ -806,8 +821,227 @@ } ], "objectGroups": [] + }, + { + "description": "the center position of the displayed part.", + "fullName": "Scroll center position", + "functionType": "ExpressionAndCondition", + "name": "ScrollCenter", + "sentence": "the scroll center position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ScrollPosition + Background.Height() / 2" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the bottom position of the displayed part.", + "fullName": "Scroll bottom position", + "functionType": "ExpressionAndCondition", + "name": "ScrollBottom", + "sentence": "the scroll bottom position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ScrollPosition + Background.Height()" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the top position of the displayed part.", + "fullName": "Scroll top position", + "functionType": "ExpressionAndCondition", + "name": "ScrollTop", + "sentence": "the scroll top position", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ScrollPosition" + ] + } + ] + } + ], + "expressionType": { + "type": "expression" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScrollCenter", + "name": "SetScrollCenter", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "=", + "Value - Background.Height() / 2", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ScrollBottom", + "name": "SetScrollBottom", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Scrollbar::Scrollbar::SetScrollPosition" + }, + "parameters": [ + "Object", + "=", + "Value - Background.Height()", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Scrollbar::Scrollbar", + "type": "object" + } + ], + "objectGroups": [] } ], + "eventsFunctionsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "functionName": "doStepPostEvents" + }, + { + "functionName": "UpdateThumbPosition" + }, + { + "functionName": "ScrollPosition" + }, + { + "functionName": "SetScrollPosition" + }, + { + "functionName": "ScrollTop" + }, + { + "functionName": "ScrollCenter" + }, + { + "functionName": "SetScrollCenter" + }, + { + "functionName": "ScrollBottom" + }, + { + "functionName": "SetScrollBottom" + }, + { + "functionName": "ContentLength" + }, + { + "functionName": "SetContentLength" + }, + { + "functionName": "IsThumbDragged" + }, + { + "functionName": "IsScrollingRequired" + } + ] + }, "propertyDescriptors": [ { "value": "0", @@ -839,7 +1073,24 @@ "label": "Hide the bar when the content is too small", "name": "ShouldHideWhenUseless" } - ] + ], + "propertiesFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "propertyName": "ScrollPosition" + }, + { + "propertyName": "ContentLength" + }, + { + "propertyName": "ThumbLengthMin" + }, + { + "propertyName": "ShouldHideWhenUseless" + } + ] + } } ] -} \ No newline at end of file +}