diff --git a/extensions/reviewed/PanelSpriteButton.json b/extensions/reviewed/PanelSpriteButton.json index 1a197010b..9723a03f4 100644 --- a/extensions/reviewed/PanelSpriteButton.json +++ b/extensions/reviewed/PanelSpriteButton.json @@ -9,7 +9,7 @@ "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": "A button that can be customized.", - "version": "1.5.0", + "version": "1.6.0", "description": [ "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.", "", @@ -1185,7 +1185,7 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, + "areaMaxX": 256, "areaMaxY": 64, "areaMaxZ": 64, "areaMinX": 0, @@ -1194,8 +1194,258 @@ "defaultName": "Button", "description": "A button that can be customized.", "fullName": "Button (panel sprite)", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "PanelSpriteButton", + "objects": [ + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "Label", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "topEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "Text", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": { + "b": 0, + "g": 0, + "r": 0 + }, + "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": "Text", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 20, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Idle", + "rightMargin": 0, + "texture": "Idle", + "tiled": false, + "topMargin": 0, + "type": "PanelSpriteObject::PanelSprite", + "width": 32, + "variables": [ + { + "folded": true, + "name": "State", + "type": "string", + "value": "Idle" + } + ], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ButtonFSM", + "type": "PanelSpriteButton::ButtonFSM", + "ShouldCheckHovering": true + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Hovered", + "rightMargin": 0, + "texture": "", + "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 + }, + { + "name": "Tween", + "type": "Tween::TweenBehavior" + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Pressed", + "rightMargin": 0, + "texture": "", + "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": "Label" + }, + { + "objectName": "Idle" + }, + { + "objectName": "Hovered" + }, + { + "objectName": "Pressed" + } + ] + }, + "objectsGroups": [ + { + "name": "Background", + "objects": [ + { + "name": "Idle" + }, + { + "name": "Hovered" + }, + { + "name": "Pressed" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "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": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Idle", + "persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 64, + "layer": "", + "name": "Label", + "persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226", + "width": 256, + "x": 0, + "y": 32, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -1225,7 +1475,7 @@ }, "parameters": [ "", - "Idle", + "Hovered", "0", "0", "" @@ -1237,7 +1487,7 @@ }, "parameters": [ "", - "Hovered", + "Pressed", "0", "0", "" @@ -1245,14 +1495,24 @@ }, { "type": { - "value": "Create" + "value": "ResizableCapability::ResizableBehavior::SetSize" + }, + "parameters": [ + "Hovered", + "Resizable", + "Idle.Width()", + "Idle.Height()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetSize" }, "parameters": [ - "", "Pressed", - "0", - "0", - "" + "Resizable", + "Idle.Width()", + "Idle.Height()" ] }, { @@ -1280,63 +1540,26 @@ "=", "1" ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Place the label over the backgrounds." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Label", - "0", - "0", - "" - ] }, { "type": { "value": "ChangePlan" }, "parameters": [ - "Label", + "Pressed", "=", - "2" + "1" ] }, { "type": { - "value": "TextObject::SetWrapping" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ "Label", - "yes" - ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "Text", + "=", + "LabelText" ] } ] @@ -1375,21 +1598,50 @@ "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + "conditions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + }, + "parameters": [ + "Object", + "" + ] + } + ], "actions": [ { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ "Object", + "=", + "PressedLabelOffsetY", "" ] } ] - } - ], - "parameters": [ + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Label", + "Text", + "=", + "LabelText" + ] + } + ] + } + ], + "parameters": [ { "description": "Object", "name": "Object", @@ -1448,12 +1700,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY()" + "0", + "" ] }, { @@ -1500,7 +1753,7 @@ "actions": [ { "type": { - "value": "Tween::AddObjectOpacityTween" + "value": "Tween::TweenBehavior::AddObjectOpacityTween2" }, "parameters": [ "Hovered", @@ -1508,7 +1761,7 @@ "\"Fadeout\"", "0", "\"linear\"", - "Object.PropertyHoveredFadeOutDuration() * 1000", + "HoveredFadeOutDuration", "" ] } @@ -1546,10 +1799,11 @@ "conditions": [ { "type": { - "value": "PanelSpriteObject::Opacity" + "value": "OpacityCapability::OpacityBehavior::Value" }, "parameters": [ "Hovered", + "Opacity", "=", "0" ] @@ -1566,10 +1820,11 @@ }, { "type": { - "value": "PanelSpriteObject::SetOpacity" + "value": "OpacityCapability::OpacityBehavior::SetValue" }, "parameters": [ "Hovered", + "Opacity", "=", "255" ] @@ -1598,12 +1853,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY()" + "0", + "" ] }, { @@ -1643,10 +1899,11 @@ }, { "type": { - "value": "PanelSpriteObject::SetOpacity" + "value": "OpacityCapability::OpacityBehavior::SetValue" }, "parameters": [ "Hovered", + "Opacity", "=", "255" ] @@ -1675,12 +1932,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY() + Object.PropertyPressedLabelOffsetY()" + "PressedLabelOffsetY", + "" ] }, { @@ -1732,12 +1990,13 @@ "actions": [ { "type": { - "value": "SetCenterY" + "value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset" }, "parameters": [ - "Label", + "Object", "=", - "Object.CenterWithPaddingY()" + "0", + "" ] }, { @@ -1769,143 +2028,6 @@ } ], "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Children instances must be resized when the button size change:\n- backgrounds for each state are resized to take the full dimensions of the button\n- the label is put back at the center of the button\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Idle.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Idle.BoundingBoxLeft(), Label.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Idle.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Idle.BoundingBoxTop(), Label.BoundingBoxTop())" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "PanelSpriteButton::Scale" - }, - "parameters": [ - "Object", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Width" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Height" - ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "variables": [ - { - "name": "Width", - "type": "number", - "value": 0 - }, - { - "name": "Height", - "type": "number", - "value": 0 - } - ] - } - ] - } - ], - "parameters": [] } ], "parameters": [ @@ -1916,22 +2038,7 @@ "type": "object" } ], - "objectGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ] + "objectGroups": [] }, { "description": "Check if the button is not used.", @@ -2161,21 +2268,13 @@ "actions": [ { "type": { - "value": "TextObject::String" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ "Label", + "Text", "=", - "LabelText" - ] - }, - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::CenterLabel" - }, - "parameters": [ - "Object", - "" + "Value" ] } ] @@ -2190,7 +2289,7 @@ }, { "description": "Text", - "name": "LabelText", + "name": "Value", "type": "string" } ], @@ -2212,7 +2311,7 @@ "value": "SetReturnString" }, "parameters": [ - "Label.String()" + "Label.Text::Value()" ] } ] @@ -2232,101 +2331,35 @@ "objectGroups": [] }, { - "description": "Return the label center Y according to the button configuration. This expression is used in doStepPostEvents when the button is pressed or released.", - "fullName": "", - "functionType": "Expression", - "name": "CenterWithPaddingY", - "private": true, - "sentence": "", + "description": "De/activate interactions with the button.", + "fullName": "De/activate interactions", + "functionType": "Action", + "name": "Activate", + "sentence": "Activate interactions with _PARAM0_: _PARAM1_", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "SetReturnNumber" + "value": "BooleanVariable" }, "parameters": [ - "Idle.CenterY() + (Object.PropertyTopPadding() - Object.PropertyBottomPadding()) / 2" + "ShouldActivate", + "True", + "" ] } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Center the label according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "", - "functionType": "Action", - "name": "CenterLabel", - "private": true, - "sentence": "Center the label of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], + ], "actions": [ { "type": { - "value": "MettreXY" - }, - "parameters": [ - "Label", - "=", - "Object.PropertyLeftPadding()", - "=", - "Object.PropertyTopPadding()" - ] - }, - { - "type": { - "value": "TextObject::WrappingWidth" - }, - "parameters": [ - "Label", - "=", - "Idle.Width() - Object.PropertyLeftPadding() - Object.PropertyRightPadding()" - ] - }, - { - "type": { - "value": "SetCenterY" + "value": "ActivateBehavior" }, "parameters": [ - "Label", - "=", - "Object.CenterWithPaddingY()" - ] - } - ], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCenterX" - }, - "parameters": [ - "Label", - "=", - "Background.CenterX() + (Object.PropertyLeftPadding() - Object.PropertyRightPadding()) / 2" - ] - } + "Idle", + "ButtonFSM", + "yes" ] } ] @@ -2336,10 +2369,12 @@ "conditions": [ { "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsPressed" + "inverted": true, + "value": "BooleanVariable" }, "parameters": [ - "Object", + "ShouldActivate", + "True", "" ] } @@ -2347,12 +2382,12 @@ "actions": [ { "type": { - "value": "MettreY" + "value": "ActivateBehavior" }, "parameters": [ - "Label", - "+", - "Object.PropertyPressedLabelOffsetY()" + "Idle", + "ButtonFSM", + "no" ] } ] @@ -2364,130 +2399,123 @@ "name": "Object", "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", "type": "object" + }, + { + "description": "Activate", + "name": "ShouldActivate", + "type": "yesorno" } ], - "objectGroups": [ - { - "name": "Background", - "objects": [ - { - "name": "Idle" - }, - { - "name": "Hovered" - }, - { - "name": "Pressed" - } - ] - } - ] + "objectGroups": [] }, { - "description": "De/activate interactions with the button.", - "fullName": "De/activate interactions", - "functionType": "Action", - "name": "Activate", - "sentence": "Activate interactions with _PARAM0_: _PARAM1_", + "description": "Check if interactions are activated on the button.", + "fullName": "Interactions activated", + "functionType": "Condition", + "name": "IsActivated", + "sentence": "Interactions on _PARAM0_ are activated", "events": [ { "type": "BuiltinCommonInstructions::Standard", "conditions": [ { "type": { - "value": "BooleanVariable" + "value": "BehaviorActivated" }, "parameters": [ - "ShouldActivate", - "True", - "" + "Idle", + "ButtonFSM" ] } ], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnBoolean" }, "parameters": [ - "Idle", - "ButtonFSM", - "yes" + "True" ] } ] - }, + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "description": "the labelOffset of the object.", + "fullName": "LabelOffset", + "functionType": "ExpressionAndCondition", + "name": "LabelOffset", + "private": true, + "sentence": "the labelOffset", + "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "ShouldActivate", - "True", - "" - ] - } - ], + "conditions": [], "actions": [ { "type": { - "value": "ActivateBehavior" + "value": "SetReturnNumber" }, "parameters": [ - "Idle", - "ButtonFSM", - "no" + "LabelOffset" ] } ] } ], + "expressionType": { + "type": "expression" + }, "parameters": [ { "description": "Object", "name": "Object", "supplementaryInformation": "PanelSpriteButton::PanelSpriteButton", "type": "object" - }, - { - "description": "Activate", - "name": "ShouldActivate", - "type": "yesorno" } ], "objectGroups": [] }, { - "description": "Check if interactions are activated on the button.", - "fullName": "Interactions activated", - "functionType": "Condition", - "name": "IsActivated", - "sentence": "Interactions on _PARAM0_ are activated", + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "LabelOffset", + "name": "SetLabelOffset", + "private": true, + "sentence": "", "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [ + "conditions": [], + "actions": [ { "type": { - "value": "BehaviorActivated" + "value": "SetCenterY" }, "parameters": [ - "Idle", - "ButtonFSM" + "Label", + "+", + "Value - LabelOffset" ] - } - ], - "actions": [ + }, { "type": { - "value": "SetReturnBoolean" + "value": "SetNumberVariable" }, "parameters": [ - "True" + "LabelOffset", + "=", + "Value" ] } ] @@ -2506,227 +2534,59 @@ ], "propertyDescriptors": [ { - "value": "0", - "type": "Number", - "label": "Label offset on Y axis when pressed", + "value": "", + "type": "String", + "label": "Label", "description": "", "group": "", "extraInformation": [], - "name": "PressedLabelOffsetY" + "name": "LabelText" }, { - "value": "0", - "type": "Number", - "label": "Left padding", - "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "LeftPadding" - }, - { - "value": "0", + "value": "0.25", "type": "Number", - "label": "Right padding", + "unit": "Second", + "label": "Hovered fade out duration", "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "RightPadding" + "group": "States", + "extraInformation": [], + "name": "HoveredFadeOutDuration" }, { "value": "0", "type": "Number", - "label": "Top padding", + "unit": "Pixel", + "label": "Label offset on Y axis when pressed", "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "TopPadding" + "group": "States", + "extraInformation": [], + "name": "PressedLabelOffsetY" }, { "value": "0", "type": "Number", - "label": "Bottom padding", - "description": "", - "group": "Padding", - "extraInformation": [ - "Label" - ], - "name": "BottomPadding" - }, - { - "value": "0.25", - "type": "Number", - "label": "Hovered fade out duration (in seconds)", + "unit": "Pixel", + "label": "", "description": "", "group": "", "extraInformation": [], - "name": "HoveredFadeOutDuration" - } - ], - "objects": [ - { - "assetStoreId": "", - "bold": false, - "italic": false, - "name": "Label", - "smoothed": true, - "type": "TextObject::Text", - "underlined": false, - "variables": [], - "effects": [], - "behaviors": [], - "string": "Text", - "font": "", - "textAlignment": "", - "characterSize": 20, - "color": { - "b": 0, - "g": 0, - "r": 0 - }, - "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": "Text", - "font": "", - "textAlignment": "", - "verticalTextAlignment": "top", - "characterSize": 20, - "color": "0;0;0" - } - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Idle", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [ - { - "folded": true, - "name": "State", - "type": "string", - "value": "Idle" - } - ], - "effects": [], - "behaviors": [ - { - "name": "ButtonFSM", - "type": "PanelSpriteButton::ButtonFSM", - "ShouldCheckHovering": true - } - ] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Hovered", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Tween", - "type": "Tween::TweenBehavior" - } - ] + "hidden": true, + "name": "LabelOffset" }, { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Pressed", - "rightMargin": 0, - "texture": "", - "tiled": false, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Label" - }, - { - "objectName": "Idle" - }, - { - "objectName": "Hovered" - }, - { - "objectName": "Pressed" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "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 - } + "value": "", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "Label.Text=LabelText" ], - "effects": [] + "hidden": true, + "name": "_PropertyMapping" } ], - "instances": [] + "variants": [] } ] } \ No newline at end of file diff --git a/extensions/reviewed/PanelSpriteContinuousBar.json b/extensions/reviewed/PanelSpriteContinuousBar.json index 77a397e8c..39bfddbc4 100644 --- a/extensions/reviewed/PanelSpriteContinuousBar.json +++ b/extensions/reviewed/PanelSpriteContinuousBar.json @@ -9,7 +9,7 @@ "name": "PanelSpriteContinuousBar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Interface Elements/ea06363a57846caab544f536b78a952234b68d4941d41c1577852a1d61aefec3_Interface Elements_interface_ui_loading_progress_bar.svg", "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "version": "1.2.1", + "version": "1.3.0", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -681,17 +681,17 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, + "areaMaxX": 256, "areaMaxY": 64, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, "areaMinZ": 0, - "assetStoreId": "", "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (continuous)", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "PanelSpriteContinuousBar", "objects": [ { @@ -704,7 +704,18 @@ "underlined": false, "variables": [], "effects": [], - "behaviors": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "useLegacyBottomAndRightAnchors": false + } + ], "string": "2 / 3", "font": "", "textAlignment": "center", @@ -731,7 +742,7 @@ "text": "2 / 3", "font": "", "textAlignment": "center", - "verticalTextAlignment": "top", + "verticalTextAlignment": "center", "characterSize": 20, "color": "0;0;0" } @@ -751,6 +762,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, { "name": "ResourceBar", "type": "PanelSpriteContinuousBar::ResourceBar", @@ -780,6 +801,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + }, { "name": "Tween", "type": "Tween::TweenBehavior" @@ -800,7 +831,18 @@ "width": 32, "variables": [], "effects": [], - "behaviors": [] + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] } ], "objectsFolderStructure": { @@ -851,7 +893,72 @@ "effects": [] } ], - "instances": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "layer": "", + "name": "Background", + "persistentUuid": "fa2b0c42-1baa-489d-9c47-87ec233cbe8c", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 44, + "layer": "", + "name": "Buffer", + "persistentUuid": "6e01eec9-ca43-4a5c-b4e1-4d9d384473e2", + "width": 236, + "x": 10, + "y": 10, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 44, + "layer": "", + "name": "FillBar", + "persistentUuid": "4833affb-a8d1-4a2b-9019-a20cf5fdc68e", + "width": 196, + "x": 10, + "y": 10, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "layer": "", + "name": "Label", + "persistentUuid": "0e63f21c-2071-4765-8254-e9021fa84ec4", + "width": 256, + "x": 0, + "y": 32, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -869,20 +976,50 @@ "textG": 0, "textR": 0 }, - "comment": "This allows to detect a change of \"intial value\" on hot reload." + "comment": "Anchors won't work as there is an absolute margin and a proportional size at the same time" }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "FillBar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "ActivateBehavior" + }, + "parameters": [ + "Buffer", + "Anchor", + "" + ] + }, { "type": { "value": "SetNumberVariable" }, "parameters": [ - "PreviousInitialValue", + "BarLeftPlusRightMargin", "=", - "InitialValue" + "Object.Width() - (max(FillBar.BoundingBoxRight(), Buffer.BoundingBoxRight()) - min(FillBar.BoundingBoxLeft(), Buffer.BoundingBoxLeft()))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BarTopPlusBottomMargin", + "=", + "Object.Height() - (max(FillBar.BoundingBoxBottom(), Buffer.BoundingBoxBottom()) - min(FillBar.BoundingBoxTop(), Buffer.BoundingBoxTop()))" ] } ] @@ -897,7 +1034,7 @@ "textG": 0, "textR": 0 }, - "comment": "Create the child-object instances." + "comment": "This allows to detect a change of \"intial value\" on hot reload." }, { "type": "BuiltinCommonInstructions::Standard", @@ -905,50 +1042,28 @@ "actions": [ { "type": { - "value": "Create" - }, - "parameters": [ - "", - "Background", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "FillBar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Background", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" + "value": "SetNumberVariable" }, "parameters": [ - "FillBar", + "PreviousInitialValue", "=", - "3" + "InitialValue" ] } ] }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "Create the child-object instances." + }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -958,7 +1073,7 @@ }, "parameters": [ "PreviousHighValueDuration", - ">", + "=", "0" ] } @@ -966,25 +1081,12 @@ "actions": [ { "type": { - "value": "Create" + "value": "Delete" }, "parameters": [ - "", "Buffer", - "0", - "0", "" ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Buffer", - "=", - "2" - ] } ] }, @@ -1000,52 +1102,6 @@ }, "comment": "Create the label over the bar." }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Label", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Label", - "=", - "4" - ] - }, - { - "type": { - "value": "TextObject::SetTextAlignment" - }, - "parameters": [ - "Label", - "\"center\"" - ] - }, - { - "type": { - "value": "TextObject::SetWrapping" - }, - "parameters": [ - "Label", - "yes" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Standard", "conditions": [ @@ -1101,45 +1157,56 @@ }, { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetValue" + "value": "PanelSpriteContinuousBar::ResourceBar::SetValue" }, "parameters": [ - "Object", + "FillBar", + "ResourceBar", "=", "InitialValue", - "Object.PropertyInitialValue()" + "" ] }, { "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" + "value": "ResizableCapability::ResizableBehavior::SetWidth" }, "parameters": [ - "Object", + "FillBar", + "Resizable", "=", - "PreviousHighValueDuration", - "" + "Object.WidthForValue()" ] }, { "type": { - "value": "Tween::RemoveTween" + "value": "ResizableCapability::ResizableBehavior::SetWidth" }, "parameters": [ - "FillBar", - "Tween", - "\"ChangeValue\"" + "Buffer", + "Resizable", + "=", + "FillBar.Width()" ] }, { "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::SetPreviousValueDuration" }, "parameters": [ - "FillBar", - "Resizable", + "Object", "=", - "Object.WidthForValue()" + "PreviousHighValueDuration", + "" + ] + }, + { + "type": { + "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLabel" + }, + "parameters": [ + "Object", + "" ] } ] @@ -1281,144 +1348,101 @@ "sentence": "", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Children instances must be resized when the parent size change:\n- background is resized to take the full dimensions of the parent\n- the bar size is refreshed according to the value\n- the label is put back at the center of the bar\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), Label.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Label.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), Label.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Label.BoundingBoxTop())" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "ScalableCapability::ScalableBehavior::SetValue" - }, - "parameters": [ - "Object", - "Scale", - "=", - "1" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" - }, - "parameters": [ - "Background", - "Resizable", - "=", - "Width" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "Background", - "Resizable", - "=", - "Height" - ] - }, - { - "type": { - "value": "PanelSpriteContinuousBar::PanelSpriteContinuousBar::UpdateLayout" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "variables": [ - { - "name": "Width", - "type": "number", - "value": 0 - }, - { - "name": "Height", - "type": "number", - "value": 0 - } - ] - } + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "OldParentWidth", + "!=", + "Object.Width()" ] } ], - "parameters": [] + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldParentWidth", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "FillBar", + "Resizable", + "=", + "Object.WidthForValue()" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Buffer", + "Resizable", + "=", + "FillBar.Width()" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "FillBar", + "Tween", + "\"ChangeValue\"" + ] + }, + { + "type": { + "value": "Tween::RemoveTween" + }, + "parameters": [ + "Buffer", + "Tween", + "\"ChangeValue\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "FillBar", + "Resizable", + "=", + "Object.Height() - BarTopPlusBottomMargin" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "Buffer", + "Resizable", + "=", + "FillBar.Height()" + ] + } + ] }, { "type": "BuiltinCommonInstructions::Standard", @@ -1533,18 +1557,6 @@ "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "BarLeftPadding", - "=", - "BarTopPadding" - ] - }, { "type": { "value": "ResizableCapability::ResizableBehavior::SetWidth" @@ -1556,35 +1568,6 @@ "Object.WidthForValue()" ] }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "FillBar", - "Resizable", - "=", - "round(Background.Height() - BarTopPadding - BarBottomPadding)" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "Buffer", - "=", - "FillBar.X()", - "=", - "FillBar.Y()" - ] - }, { "type": { "value": "ResizableCapability::ResizableBehavior::SetWidth" @@ -1595,65 +1578,6 @@ "=", "FillBar.Width()" ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "Buffer", - "Resizable", - "=", - "FillBar.Height()" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "Label", - "=", - "BarLeftPadding", - "=", - "BarTopPadding" - ] - }, - { - "type": { - "value": "TextObject::WrappingWidth" - }, - "parameters": [ - "Label", - "=", - "Object.FullBarWidth()" - ] - }, - { - "type": { - "value": "SetCenterY" - }, - "parameters": [ - "Label", - "=", - "FillBar.CenterY()" - ] - }, - { - "type": { - "value": "SetCenterX" - }, - "parameters": [ - "Label", - "=", - "Background.CenterX() + (BarLeftPadding - BarRightPadding) / 2" - ] } ] } @@ -2257,7 +2181,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Background.Width() - BarLeftPadding - BarRightPadding" + "Object.Width() - BarLeftPlusRightMargin" ] } ] @@ -2454,58 +2378,6 @@ } ], "propertyDescriptors": [ - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "name": "BarLeftPadding" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "name": "BarTopPadding" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "name": "BarRightPadding" - }, - { - "value": "0", - "type": "Number", - "label": "", - "description": "", - "group": "Bar", - "extraInformation": [ - "Label", - "FillBar", - "Buffer" - ], - "name": "BarBottomPadding" - }, { "value": "3", "type": "Number", @@ -2537,6 +2409,7 @@ { "value": "1", "type": "Number", + "unit": "Second", "label": "Previous high value conservation duration (in seconds)", "description": "", "group": "Animation", @@ -2546,6 +2419,7 @@ { "value": "0.25", "type": "Number", + "unit": "Second", "label": "Easing duration", "description": "", "group": "Animation", @@ -2564,40 +2438,24 @@ "name": "ShowLabel" }, { - "value": "", - "type": "Boolean", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Buffer" - ], - "hidden": true, - "name": "ShowBuffer" - }, - { - "value": "Center", - "type": "String", + "value": "0", + "type": "Number", "label": "", - "description": "Only used by the scene editor.", + "description": "", "group": "", - "extraInformation": [ - "Label" - ], + "extraInformation": [], "hidden": true, - "name": "LabelVerticalAnchorOrigin" + "name": "BarLeftPlusRightMargin" }, { - "value": "Center", - "type": "String", + "value": "0", + "type": "Number", "label": "", - "description": "Only used by the scene editor.", + "description": "", "group": "", - "extraInformation": [ - "FillBar" - ], + "extraInformation": [], "hidden": true, - "name": "LabelVerticalAnchorTarget" + "name": "BarTopPlusBottomMargin" } ], "variants": [] diff --git a/extensions/reviewed/PanelSpriteSlider.json b/extensions/reviewed/PanelSpriteSlider.json index 097d52780..9793da105 100644 --- a/extensions/reviewed/PanelSpriteSlider.json +++ b/extensions/reviewed/PanelSpriteSlider.json @@ -9,7 +9,7 @@ "name": "PanelSpriteSlider", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg", "shortDescription": "A draggable slider that users can move to select a numerical value.", - "version": "1.5.1", + "version": "1.6.0", "description": [ "A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.", "", @@ -1629,17 +1629,17 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, + "areaMaxX": 256, "areaMaxY": 64, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, "areaMinZ": 0, - "assetStoreId": "", "defaultName": "Slider", "description": "Let users select a numerical value by dragging a slider.", "fullName": "Slider", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "PanelSpriteSlider", "objects": [ { @@ -1699,6 +1699,16 @@ "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, { "name": "Draggable", "type": "DraggableBehavior::Draggable", @@ -1714,13 +1724,23 @@ "name": "FillBar", "rightMargin": 0, "texture": "", - "tiled": true, + "tiled": false, "topMargin": 0, "type": "PanelSpriteObject::PanelSprite", "width": 32, "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + }, { "name": "Slider", "type": "PanelSpriteSlider::Slider", @@ -1739,13 +1759,23 @@ "name": "Background", "rightMargin": 0, "texture": "", - "tiled": true, + "tiled": false, "topMargin": 0, "type": "PanelSpriteObject::PanelSprite", "width": 32, "variables": [], "effects": [], "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "topEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "useLegacyBottomAndRightAnchors": false + }, { "name": "ButtonFSM", "type": "PanelSpriteSlider::ButtonFSM", @@ -1807,7 +1837,56 @@ "effects": [] } ], - "instances": [], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "layer": "", + "name": "Background", + "persistentUuid": "7b36a716-8a01-496a-ad7d-0de60daff8f9", + "width": 256, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 44, + "layer": "", + "name": "FillBar", + "persistentUuid": "e775f69e-7845-4103-8a05-5266aba60742", + "width": 236, + "x": 10, + "y": 10, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 84, + "layer": "", + "name": "Thumb", + "persistentUuid": "476a27da-e34f-451f-b660-04a6bbefddbe", + "width": 32, + "x": 230, + "y": -10, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -1825,35 +1904,7 @@ "textG": 0, "textR": 0 }, - "comment": "This allows to detect a change of \"intial value\" on hot reload." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "PreviousInitialValue", - "=", - "InitialValue" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create the child-object instances." + "comment": "Anchors won't work as there is an absolute margin and a proportional size at the same time" }, { "type": "BuiltinCommonInstructions::Standard", @@ -1861,68 +1912,70 @@ "actions": [ { "type": { - "value": "Create" - }, - "parameters": [ - "", - "Background", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" + "value": "ActivateBehavior" }, "parameters": [ - "", "FillBar", - "0", - "0", + "Anchor", "" ] }, { "type": { - "value": "Create" + "value": "ActivateBehavior" }, "parameters": [ - "", "Thumb", - "0", - "0", + "Anchor", "" ] }, { "type": { - "value": "ChangePlan" + "value": "SetNumberVariable" }, "parameters": [ - "Background", + "BarLeftPlusRightMargin", "=", - "1" + "Object.Width() - FillBar.Width()" ] }, { "type": { - "value": "ChangePlan" + "value": "SetNumberVariable" }, "parameters": [ - "FillBar", + "BarTopPlusBottomMargin", "=", - "2" + "Object.Height() - FillBar.Height()" ] - }, + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "This allows to detect a change of \"intial value\" on hot reload." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { - "value": "ChangePlan" + "value": "SetNumberVariable" }, "parameters": [ - "Thumb", + "PreviousInitialValue", "=", - "3" + "InitialValue" ] } ] @@ -1955,25 +2008,6 @@ "" ] }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Label", - "=", - "4" - ] - }, - { - "type": { - "value": "TextObject::SetWrapping" - }, - "parameters": [ - "Label", - "no" - ] - }, { "type": { "value": "Cache" @@ -2076,15 +2110,6 @@ "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" - }, - "parameters": [ - "Object", - "" - ] - }, { "type": { "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateSliderConfiguration" @@ -2151,6 +2176,79 @@ "name": "doStepPostEvents", "sentence": "", "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "OldParentWidth", + "!=", + "Object.Width()" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "OldParentWidth", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetHeight" + }, + "parameters": [ + "FillBar", + "Resizable", + "=", + "Object.Height() - BarTopPlusBottomMargin" + ] + }, + { + "type": { + "value": "SetCenterY" + }, + "parameters": [ + "Thumb", + "=", + "FillBar.CenterY()" + ] + }, + { + "type": { + "value": "MettreY" + }, + "parameters": [ + "Label", + "=", + "Thumb.Y() - Label.Height() - LabelMargin" + ] + } + ] + }, { "colorB": 228, "colorG": 176, @@ -2235,7 +2333,7 @@ "parameters": [ "Object", "=", - "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (TouchX(Background.ButtonFSM::TouchId(), Object.Layer()) - Object.FullBarLeft()) / Object.FullBarWidth()", + "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (TouchX(Background.ButtonFSM::TouchId(), Object.Layer()) - FillBar.X()) / Object.FullBarWidth()", "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (MouseX() - Object.FullBarLeft()) / Object.FullBarWidth()" ] } @@ -2299,7 +2397,7 @@ "parameters": [ "Object", "=", - "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (Thumb.CenterX() - Object.FullBarLeft()) / Object.FullBarWidth()", + "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (Thumb.CenterX() - FillBar.X()) / Object.FullBarWidth()", "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (Thumb.CenterX() - Object.FullBarLeft()) / Object.FullBarWidth()" ] } @@ -2442,189 +2540,6 @@ } ], "parameters": [] - }, - { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Children instances must be resized when the parent size change:\n- background is resized to take the full dimensions of the parent\n- the label is put back at the center of the bar\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), max(Label.BoundingBoxRight(), Thumb.BoundingBoxRight())) - min(Background.BoundingBoxLeft(), min(Label.BoundingBoxLeft(), Thumb.BoundingBoxLeft()))" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), max(Label.BoundingBoxBottom(), Thumb.BoundingBoxBottom())) - min(Background.BoundingBoxTop(), min(Label.BoundingBoxTop(), Thumb.BoundingBoxTop()))" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "ScalableCapability::ScalableBehavior::SetValue" - }, - "parameters": [ - "Object", - "Scale", - "=", - "1" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetWidth" - }, - "parameters": [ - "Background", - "Resizable", - "=", - "Width" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "Background", - "Resizable", - "=", - "Height" - ] - }, - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "variables": [ - { - "name": "Width", - "type": "number", - "value": 0 - }, - { - "name": "Height", - "type": "number", - "value": 0 - } - ] - } - ] - } - ], - "parameters": [] - }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "The parent size is not defined in onCreate so it needs to be done here." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" - }, - "parameters": [ - "Object", - "" - ] - }, - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" - }, - "parameters": [ - "Object", - "" - ] - } - ] } ], "parameters": [ @@ -2853,15 +2768,6 @@ "" ] }, - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" - }, - "parameters": [ - "Object", - "" - ] - }, { "type": { "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" @@ -2949,15 +2855,6 @@ "" ] }, - { - "type": { - "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateLayout" - }, - "parameters": [ - "Object", - "" - ] - }, { "type": { "value": "PanelSpriteSlider::PanelSpriteSlider::UpdateThumbPosition" @@ -3204,54 +3101,6 @@ ], "objectGroups": [] }, - { - "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "Update layout", - "functionType": "Action", - "name": "UpdateLayout", - "private": true, - "sentence": "Update layout of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "Object.PropertyBarLeftPadding()", - "=", - "Object.PropertyBarTopPadding()" - ] - }, - { - "type": { - "value": "ResizableCapability::ResizableBehavior::SetHeight" - }, - "parameters": [ - "FillBar", - "Resizable", - "=", - "round(Background.Height() - Object.PropertyBarTopPadding() - Object.PropertyBarBottomPadding())" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", - "type": "object" - } - ], - "objectGroups": [] - }, { "description": "Update the thumb position according to the slider value.", "fullName": "Update thumb position", @@ -3306,7 +3155,7 @@ "parameters": [ "Thumb", "=", - "Object.FullBarLeft() + FillBar.Width()" + "FillBar.X() + FillBar.Width()" ] }, { @@ -3381,76 +3230,6 @@ ], "objectGroups": [] }, - { - "fullName": "", - "functionType": "Expression", - "name": "FullBarLeft", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "BarLeftPadding" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Expression", - "name": "FullBarRight", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "Background.Width() - BarRightPadding" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "PanelSpriteSlider::PanelSpriteSlider", - "type": "object" - } - ], - "objectGroups": [] - }, { "fullName": "", "functionType": "Expression", @@ -3467,7 +3246,7 @@ "value": "SetReturnNumber" }, "parameters": [ - "Background.Width() - BarLeftPadding - BarRightPadding" + "Object.Width() - BarLeftPlusRightMargin" ] } ] @@ -3716,6 +3495,7 @@ "Label", "FillBar" ], + "hidden": true, "name": "BarLeftPadding" }, { @@ -3728,6 +3508,7 @@ "Label", "FillBar" ], + "hidden": true, "name": "BarTopPadding" }, { @@ -3740,6 +3521,7 @@ "Label", "FillBar" ], + "hidden": true, "name": "BarRightPadding" }, { @@ -3752,6 +3534,7 @@ "Label", "FillBar" ], + "hidden": true, "name": "BarBottomPadding" }, { @@ -3766,6 +3549,7 @@ { "value": "8", "type": "Number", + "unit": "Pixel", "label": "Label margin", "description": "", "group": "Label", @@ -3775,6 +3559,7 @@ { "value": "0", "type": "Number", + "unit": "Dimensionless", "label": "Minimum value", "description": "", "group": "Value", @@ -3784,6 +3569,7 @@ { "value": "100", "type": "Number", + "unit": "Dimensionless", "label": "Maximum value", "description": "", "group": "Value", @@ -3793,6 +3579,7 @@ { "value": "1", "type": "Number", + "unit": "Dimensionless", "label": "Step size", "description": "", "group": "Value", @@ -3802,6 +3589,7 @@ { "value": "50", "type": "Number", + "unit": "Dimensionless", "label": "Initial value", "description": "", "group": "Value", @@ -3853,6 +3641,26 @@ ], "hidden": true, "name": "ShowLabel" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "BarLeftPlusRightMargin" + }, + { + "value": "0", + "type": "Number", + "label": "", + "description": "", + "group": "", + "extraInformation": [], + "hidden": true, + "name": "BarTopPlusBottomMargin" } ], "variants": [] diff --git a/extensions/reviewed/SpriteToggleSwitch.json b/extensions/reviewed/SpriteToggleSwitch.json index 4093cb261..142cb7cb4 100644 --- a/extensions/reviewed/SpriteToggleSwitch.json +++ b/extensions/reviewed/SpriteToggleSwitch.json @@ -2,14 +2,14 @@ "author": "", "category": "User interface", "extensionNamespace": "", - "gdevelopVersion": ">=5.5.222", "fullName": "Toggle switch", + "gdevelopVersion": ">=5.5.222", "helpPath": "/objects/toggle-switch", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIzLDIzSDljLTMuOSwwLTctMy4xLTctN3YwYzAtMy45LDMuMS03LDctN2gxNGMzLjksMCw3LDMuMSw3LDd2MEMzMCwxOS45LDI2LjksMjMsMjMsMjN6Ii8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSI5IiBjeT0iMTYiIHI9IjQiLz4NCjwvc3ZnPg0K", "name": "SpriteToggleSwitch", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/8d0cd8cd0c9318f4f6efde6ee6b4c192bd19306467f80c9970387a259300f895_Interface Elements_interface_ui_toggle_switch_on_off.svg", "shortDescription": "Toggle switch that users can click or touch.", - "version": "1.4.0", + "version": "1.5.0", "description": [ "Toggle switch that users can click or touch. The switch can be customized with sprites.", "", @@ -31,6 +31,8 @@ "gqDaZjCfevOOxBYkK6zlhtZnXCg1" ], "dependencies": [], + "globalVariables": [], + "sceneVariables": [], "eventsFunctions": [], "eventsBasedBehaviors": [ { @@ -1867,47 +1869,135 @@ ], "eventsBasedObjects": [ { + "areaMaxX": 64, + "areaMaxY": 64, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, "defaultName": "ToggleSwitch", "description": "A toggle switch that users can click or touch.", "fullName": "Toggle switch", + "isUsingLegacyInstancesRenderer": false, "name": "SpriteToggleSwitch", - "eventsFunctions": [ + "objects": [ { - "fullName": "", - "functionType": "Action", - "name": "onCreated", - "sentence": "", - "events": [ + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "State", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create one background instance for of each state." + "name": "ButtonFSM", + "type": "SpriteToggleSwitch::ButtonFSM", + "ShouldCheckHovering": true, + "State": "Idle", + "TouchId": 0, + "TouchIsInside": false, + "MouseIsInside": false, + "Index": 0 }, { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "name": "SwitchFSM", + "type": "SpriteToggleSwitch::SwitchFSM", + "ButtonFSM": "ButtonFSM", + "IsChecked": false, + "WasChecked": false + } + ], + "animations": [ + { + "name": "Unchecked", + "useMultipleDirections": false, + "directions": [ { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "State", - "0", - "0", - "" - ] + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] } ] }, + { + "name": "Checked", + "useMultipleDirections": false, + "directions": [ + { + "looping": false, + "timeBetweenFrames": 0.08, + "sprites": [] + } + ] + } + ] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "State" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "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": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 64, + "layer": "", + "name": "State", + "persistentUuid": "bda60bb1-c312-4710-baf7-ec7a3887c076", + "width": 64, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -2947,69 +3037,7 @@ "hidden": true, "name": "PreviousIsChecked" } - ], - "objects": [ - { - "adaptCollisionMaskAutomatically": true, - "assetStoreId": "", - "name": "State", - "type": "Sprite", - "updateIfNotVisible": false, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "ButtonFSM", - "type": "SpriteToggleSwitch::ButtonFSM", - "ShouldCheckHovering": true, - "State": "Idle", - "TouchId": 0, - "TouchIsInside": false, - "MouseIsInside": false, - "Index": 0 - }, - { - "name": "SwitchFSM", - "type": "SpriteToggleSwitch::SwitchFSM", - "ButtonFSM": "ButtonFSM", - "IsChecked": false, - "WasChecked": false - } - ], - "animations": [ - { - "name": "Unchecked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - }, - { - "name": "Checked", - "useMultipleDirections": false, - "directions": [ - { - "looping": false, - "timeBetweenFrames": 0.08, - "sprites": [] - } - ] - } - ] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "State" - } - ] - } + ] } ] } \ No newline at end of file diff --git a/extensions/reviewed/TiledUnitsBar.json b/extensions/reviewed/TiledUnitsBar.json index 9a6786ca0..ff53aa59c 100644 --- a/extensions/reviewed/TiledUnitsBar.json +++ b/extensions/reviewed/TiledUnitsBar.json @@ -2,14 +2,14 @@ "author": "", "category": "User interface", "extensionNamespace": "", - "gdevelopVersion": ">=5.5.222", "fullName": "Resource bar (separated units)", + "gdevelopVersion": ">=5.5.222", "helpPath": "/objects/resource-bar", "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWRvdHMtaG9yaXpvbnRhbCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik0xNiwxMkEyLDIgMCAwLDEgMTgsMTBBMiwyIDAgMCwxIDIwLDEyQTIsMiAwIDAsMSAxOCwxNEEyLDIgMCAwLDEgMTYsMTJNMTAsMTJBMiwyIDAgMCwxIDEyLDEwQTIsMiAwIDAsMSAxNCwxMkEyLDIgMCAwLDEgMTIsMTRBMiwyIDAgMCwxIDEwLDEyTTQsMTJBMiwyIDAgMCwxIDYsMTBBMiwyIDAgMCwxIDgsMTJBMiwyIDAgMCwxIDYsMTRBMiwyIDAgMCwxIDQsMTJaIiAvPjwvc3ZnPg==", "name": "TiledUnitsBar", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/063e9152cf65bc0f3be2a828afd950c3ecf1b1fc72feefdc2467252fe987dc0f_dots-horizontal.svg", "shortDescription": "A bar that represents a resource in the game (health, mana, ammo, etc).", - "version": "1.2.1", + "version": "1.3.0", "description": [ "A bar that represents a resource in the game (health, mana, ammo, etc).", "", @@ -37,7 +37,102 @@ "dependencies": [], "globalVariables": [], "sceneVariables": [], - "eventsFunctions": [], + "eventsFunctions": [ + { + "description": "left anchor", + "fullName": "Left anchor", + "functionType": "ExpressionAndCondition", + "name": "LeftEdgeAnchor", + "private": true, + "sentence": "Left anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "", + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._leftEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + }, + { + "description": "left anchor", + "fullName": "Right anchor", + "functionType": "ExpressionAndCondition", + "name": "RightEdgeAnchor", + "private": true, + "sentence": "Right anchor of _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": [ + "", + "gdjs._TiledUnitsBarExtension = gdjs._TiledUnitsBarExtension || {", + " anchors: [\"None\", \"Min\", \"Max\", \"Proportional\", \"Center\"]", + "}", + "const { anchors } = gdjs._TiledUnitsBarExtension;", + "", + "const object = objects[0];", + "/** @type {gdjs.AnchorRuntimeBehavior} */", + "const anchor = object.getBehavior(eventsFunctionContext.getBehaviorName(\"Anchor\"));", + "eventsFunctionContext.returnValue = anchors[anchor._rightEdgeAnchor] || \"None\";", + "" + ], + "parameterObjects": "Object", + "useStrict": true, + "eventsSheetExpanded": true + } + ], + "expressionType": { + "supplementaryInformation": "[\"None\",\"Min\",\"Max\",\"Proportional\",\"Center\"]", + "type": "stringWithSelector" + }, + "parameters": [ + { + "description": "Object", + "name": "Object", + "type": "objectList" + }, + { + "description": "Anchor", + "name": "Anchor", + "supplementaryInformation": "AnchorBehavior::AnchorBehavior", + "type": "behavior" + } + ], + "objectGroups": [] + } + ], "eventsBasedBehaviors": [ { "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", @@ -682,8 +777,8 @@ ], "eventsBasedObjects": [ { - "areaMaxX": 64, - "areaMaxY": 64, + "areaMaxX": 96, + "areaMaxY": 32, "areaMaxZ": 64, "areaMinX": 0, "areaMinY": 0, @@ -691,8 +786,186 @@ "defaultName": "ResourceBar", "description": "A bar that represents a resource in the game (health, mana, ammo, etc).", "fullName": "Resource bar (separated units)", - "isUsingLegacyInstancesRenderer": true, + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, "name": "TiledUnitsBar", + "objects": [ + { + "assetStoreId": "", + "height": 32, + "name": "FillBar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + }, + { + "name": "ResourceBar", + "type": "TiledUnitsBar::ResourceBar", + "Value": 1, + "MaxValue": 3, + "PreviousValue": 0 + } + ] + }, + { + "assetStoreId": "", + "height": 32, + "name": "Bar", + "texture": "", + "type": "TiledSpriteObject::TiledSprite", + "width": 32, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 4, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 4, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Background", + "rightMargin": 0, + "texture": "", + "tiled": true, + "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": "FillBar" + }, + { + "objectName": "Bar" + }, + { + "objectName": "Background" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "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": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 32, + "keepRatio": true, + "layer": "", + "name": "Background", + "persistentUuid": "b13e773c-6941-4f67-b198-030f29c8b679", + "width": 96, + "x": 0, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "keepRatio": true, + "layer": "", + "name": "Bar", + "persistentUuid": "caf6fdad-096d-4247-b23b-6cc1a89ce9f8", + "width": 90, + "x": 3, + "y": 3, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 26, + "layer": "", + "name": "FillBar", + "persistentUuid": "4b784a8f-dbae-4d8b-a287-628642416d10", + "width": 60, + "x": 3, + "y": 3, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], "eventsFunctions": [ { "fullName": "", @@ -728,116 +1001,6 @@ } ] }, - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Create the child-object instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Background", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "Bar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "Create" - }, - "parameters": [ - "", - "FillBar", - "0", - "0", - "" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Background", - "=", - "1" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "Bar", - "=", - "2" - ] - }, - { - "type": { - "value": "ChangePlan" - }, - "parameters": [ - "FillBar", - "=", - "3" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "inverted": true, - "value": "BooleanVariable" - }, - "parameters": [ - "ShowBackground", - "True", - "" - ] - } - ], - "actions": [ - { - "type": { - "value": "Cache" - }, - "parameters": [ - "Background" - ] - } - ] - }, { "type": "BuiltinCommonInstructions::Comment", "color": { @@ -899,15 +1062,6 @@ "type": "BuiltinCommonInstructions::Standard", "conditions": [], "actions": [ - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" - ] - }, { "type": { "value": "TiledUnitsBar::TiledUnitsBar::SetMaxValue" @@ -971,250 +1125,20 @@ "objectGroups": [] }, { - "fullName": "", - "functionType": "Action", - "name": "doStepPostEvents", - "sentence": "", + "description": "the value of the object.", + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "group": "Resource bar", + "name": "Value", + "sentence": "the value", "events": [ { - "colorB": 228, - "colorG": 176, - "colorR": 74, - "creationTime": 0, - "name": "Resize", - "source": "", - "type": "BuiltinCommonInstructions::Group", - "events": [ + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "Children instances must be resized when the button size change:\n- background is resized to take the full dimensions of the button\n- the bar size is refreshed according to the value\n\nThe scale is set back to 1 because it means that the parent instance has the same dimensions as the union of its children instances." - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Width()", - "!=", - "max(Background.BoundingBoxRight(), Bar.BoundingBoxRight()) - min(Background.BoundingBoxLeft(), Bar.BoundingBoxLeft())" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::CompareNumbers" - }, - "parameters": [ - "Object.Height()", - "!=", - "max(Background.BoundingBoxBottom(), Bar.BoundingBoxBottom()) - min(Background.BoundingBoxTop(), Bar.BoundingBoxTop())" - ] - } - ] - } - ], - "actions": [], - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Width", - "=", - "Object.Width()" - ] - }, - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "Height", - "=", - "Object.Height()" - ] - }, - { - "type": { - "value": "ScalableCapability::ScalableBehavior::SetValue" - }, - "parameters": [ - "Object", - "Scale", - "=", - "1" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Width" - }, - "parameters": [ - "Background", - "=", - "Width" - ] - }, - { - "type": { - "value": "PanelSpriteObject::Height" - }, - "parameters": [ - "Background", - "=", - "Height" - ] - }, - { - "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" - }, - "parameters": [ - "Object", - "" - ] - } - ], - "variables": [ - { - "name": "Width", - "type": "number", - "value": 0 - }, - { - "name": "Height", - "type": "number", - "value": 0 - } - ] - } - ] - } - ], - "parameters": [] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Center the bar according to the button configuration. This is used in doStepPostEvents when the button is resized.", - "fullName": "", - "functionType": "Action", - "name": "CenterBar", - "private": true, - "sentence": "Center the bar of _PARAM0_", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetCenter" - }, - "parameters": [ - "Bar", - "=", - "Background.CenterX()", - "=", - "Background.CenterY()" - ] - }, - { - "type": { - "value": "MettreX" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - }, - { - "type": { - "value": "MettreY" - }, - "parameters": [ - "Bar", - "+", - "0" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "MettreXY" - }, - "parameters": [ - "FillBar", - "=", - "Bar.X()", - "=", - "Bar.Y()" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TiledUnitsBar::TiledUnitsBar", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the value of the object.", - "fullName": "Value", - "functionType": "ExpressionAndCondition", - "group": "Resource bar", - "name": "Value", - "sentence": "the value", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" + "type": { + "value": "SetReturnNumber" }, "parameters": [ "FillBar.ResourceBar::Value()" @@ -1346,20 +1270,111 @@ "events": [ { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ + "conditions": [ { "type": { - "value": "TiledUnitsBar::ResourceBar::SetMaxValue" + "value": "TiledUnitsBar::LeftEdgeAnchor" }, "parameters": [ - "FillBar", - "ResourceBar", + "", "=", - "Value", + "\"Center\"", + "Bar", + "Anchor", "" ] }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Center\"", + "Bar", + "Anchor", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "(Value - FillBar.ResourceBar::MaxValue()) * UnitWidth / 2" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "TiledUnitsBar::LeftEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::RightEdgeAnchor" + }, + "parameters": [ + "", + "=", + "\"Max\"", + "Bar", + "Anchor", + "" + ] + } + ] + }, + { + "type": { + "value": "AjoutObjConcern" + }, + "parameters": [ + "", + "Bar" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreX" + }, + "parameters": [ + "Bar", + "-", + "(Value - FillBar.ResourceBar::MaxValue()) * UnitWidth" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ { "type": { "value": "ResizableCapability::ResizableBehavior::SetWidth" @@ -1373,10 +1388,34 @@ }, { "type": { - "value": "TiledUnitsBar::TiledUnitsBar::CenterBar" + "value": "MettreX" + }, + "parameters": [ + "FillBar", + "=", + "Bar.X()" + ] + }, + { + "type": { + "value": "TiledUnitsBar::ResourceBar::SetMaxValue" + }, + "parameters": [ + "FillBar", + "ResourceBar", + "=", + "Value", + "" + ] + }, + { + "type": { + "value": "TiledUnitsBar::TiledUnitsBar::SetValue" }, "parameters": [ "Object", + "=", + "Object.Value()", "" ] } @@ -1528,164 +1567,8 @@ "group": "", "extraInformation": [], "name": "UnitWidth" - }, - { - "value": "true", - "type": "Boolean", - "label": "Show the background", - "description": "", - "group": "", - "extraInformation": [ - "Background" - ], - "name": "ShowBackground" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Bar left margin", - "description": "", - "group": "", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarLeftPadding" - }, - { - "value": "0", - "type": "Number", - "unit": "Pixel", - "label": "Bar right margin", - "description": "", - "group": "", - "extraInformation": [ - "FillBar", - "Bar" - ], - "name": "BarRightPadding" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "FillBar", - "Bar" - ], - "hidden": true, - "name": "BarVerticalAnchorOrigin" - }, - { - "value": "Center", - "type": "String", - "label": "", - "description": "Only used by the scene editor.", - "group": "", - "extraInformation": [ - "Background" - ], - "hidden": true, - "name": "BarVerticalAnchorTarget" } - ], - "objects": [ - { - "assetStoreId": "", - "height": 32, - "name": "FillBar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "ResourceBar", - "type": "TiledUnitsBar::ResourceBar", - "Value": 1, - "MaxValue": 3, - "PreviousValue": 0 - } - ] - }, - { - "assetStoreId": "", - "height": 32, - "name": "Bar", - "texture": "", - "type": "TiledSpriteObject::TiledSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - }, - { - "assetStoreId": "", - "bottomMargin": 0, - "height": 32, - "leftMargin": 0, - "name": "Background", - "rightMargin": 0, - "texture": "", - "tiled": true, - "topMargin": 0, - "type": "PanelSpriteObject::PanelSprite", - "width": 32, - "variables": [], - "effects": [], - "behaviors": [] - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "FillBar" - }, - { - "objectName": "Bar" - }, - { - "objectName": "Background" - } - ] - }, - "objectsGroups": [], - "layers": [ - { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "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": [] - } - ], - "instances": [] + ] } ] } \ No newline at end of file diff --git a/extensions/reviewed/TwoChoicesDialogBoxes.json b/extensions/reviewed/TwoChoicesDialogBoxes.json index 888d99a15..55b436132 100644 --- a/extensions/reviewed/TwoChoicesDialogBoxes.json +++ b/extensions/reviewed/TwoChoicesDialogBoxes.json @@ -9,7 +9,7 @@ "name": "TwoChoicesDialogBoxes", "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Interface Elements/0842ffc478006e9b6687fca9a5761494c4efd1df873220637af5b4ac7253f850_Interface Elements_interface_ui_window_application_app_button_cta.svg", "shortDescription": "A dialog box with buttons to let users make a choice.", - "version": "0.2.0", + "version": "0.2.1", "description": [ "A dialog box showing multiple options (usually \"yes\" and \"no\") and a customizable text message.", "It handles keyboard, gamepad and touch controls." @@ -49,6 +49,294 @@ "isTextContainer": true, "isUsingLegacyInstancesRenderer": false, "name": "TwoChoicesDialogBox", + "objects": [ + { + "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", + "name": "NoButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Semi-transparent black and white", + "variables": [ + { + "name": "ID", + "type": "number", + "value": 0 + } + ], + "effects": [ + { + "effectType": "Outline", + "name": "OutlineEffect", + "doubleParameters": { + "padding": 0, + "thickness": 2 + }, + "stringParameters": { + "color": "255;255;255" + }, + "booleanParameters": {} + } + ], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 8, + "RightPadding": 8, + "PressedLabelOffsetY": 0, + "IdleLabelOffsetY": -8, + "BottomPadding": 8, + "TopPadding": 8, + "MinimalWidth": 300 + } + }, + { + "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", + "name": "YesButton", + "type": "PanelSpriteButton::PanelSpriteButton", + "variant": "Semi-transparent black and white", + "variables": [ + { + "name": "ID", + "type": "number", + "value": 0 + } + ], + "effects": [ + { + "effectType": "Outline", + "name": "OutlineEffect", + "doubleParameters": { + "padding": 0, + "thickness": 2 + }, + "stringParameters": { + "color": "255;255;255" + }, + "booleanParameters": {} + } + ], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 0, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 0, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "LeftPadding": 8, + "RightPadding": 8, + "PressedLabelOffsetY": 0, + "IdleLabelOffsetY": -8, + "BottomPadding": 8, + "TopPadding": 8, + "MinimalWidth": 300 + } + }, + { + "assetStoreId": "", + "bottomMargin": 16, + "height": 48, + "leftMargin": 16, + "name": "TextBorder", + "rightMargin": 16, + "texture": "Border.png", + "tiled": true, + "topMargin": 16, + "type": "PanelSpriteObject::PanelSprite", + "width": 48, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "name": "Dialogue", + "type": "BitmapText::BitmapTextObject", + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 2, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 1, + "useLegacyBottomAndRightAnchors": false + } + ], + "content": { + "text": "Default message. Continue?", + "opacity": 255, + "scale": 2, + "fontSize": 20, + "tint": "255;255;255", + "bitmapFontResourceName": "8BitOperatorPlus8Regular_Edited.fnt", + "textureAtlasResourceName": "8BitOperatorPlus8Regular_Edited.png", + "align": "left", + "wordWrap": true + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Dialogue" + }, + { + "objectName": "TextBorder" + }, + { + "objectName": "YesButton" + }, + { + "objectName": "NoButton" + } + ] + }, + "objectsGroups": [ + { + "name": "Buttons", + "objects": [ + { + "name": "NoButton" + }, + { + "name": "YesButton" + } + ] + } + ], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "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": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "depth": 1, + "height": 124, + "layer": "", + "name": "Dialogue", + "persistentUuid": "c7183394-9ca6-4c16-9d13-f0b7cfe803d8", + "width": 554, + "x": 19, + "y": 18, + "zOrder": 45, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 0, + "height": 213, + "layer": "", + "name": "TextBorder", + "persistentUuid": "639d5661-817d-4faa-b33b-c0ff129c309a", + "width": 600, + "x": 0, + "y": 0, + "zOrder": 43, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 32, + "height": 36, + "layer": "", + "name": "YesButton", + "persistentUuid": "a0ca78d3-0a23-4bbe-89de-fb2d0a53996c", + "width": 105, + "x": 350, + "y": 160, + "zOrder": 510, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "depth": 32, + "height": 36, + "layer": "", + "name": "NoButton", + "persistentUuid": "6781aafa-3ae9-4820-bb97-682a524a0cf6", + "width": 103, + "x": 471, + "y": 160, + "zOrder": 510, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [ + { + "name": "ID", + "persistentUuid": "bb563dbe-93eb-4412-b843-f60016b9a893", + "type": "number", + "value": 1 + } + ] + } + ], "eventsFunctions": [ { "fullName": "", @@ -382,240 +670,104 @@ "r": 255, "textB": 0, "textG": 0, - "textR": 0 - }, - "comment": "To escape the dialog we can focus the button with the identifier 1 which is usually the button to cancel/deny by pressing one of the key or buttons" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BooleanVariable" - }, - "parameters": [ - "EnableEscape", - "True", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Escape" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"B\"", - "" - ] - } - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Once" - }, - "parameters": [] - } - ], - "actions": [ - { - "type": { - "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::SetActiveButtonById" - }, - "parameters": [ - "Object", - "=", - "1", - "" - ] - } - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "Action", - "name": "onHotReloading", - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" - }, - "parameters": [ - "Object", - "Text", - "=", - "TextMessage" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "Check if the \"Yes\" button of the dialog was selected.", - "fullName": "\"Yes\" button is clicked", - "functionType": "Condition", - "name": "IsYesClicked", - "sentence": "\"Yes\" button of _PARAM0_ is clicked", - "events": [ - { - "type": "BuiltinCommonInstructions::Comment", - "color": { - "b": 109, - "g": 230, - "r": 255, - "textB": 0, - "textG": 0, - "textR": 0 - }, - "comment": "The button is clicked\nOr\nThe button is active and a key is pressed to validate the button" - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" - }, - "parameters": [ - "YesButton", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::And" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::ActiveButtonById" - }, - "parameters": [ - "Object", - "=", - "0", - "" - ] - }, - { - "type": { - "value": "BuiltinCommonInstructions::Or" - }, - "parameters": [], - "subInstructions": [ - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "NumpadReturn" - ] - }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Return" - ] - }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Space" - ] - }, - { - "type": { - "value": "Gamepads::C_Button_pressed" - }, - "parameters": [ - "", - "1", - "\"A\"", - "" - ] - }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Space" - ] - } + "textR": 0 + }, + "comment": "To escape the dialog we can focus the button with the identifier 1 which is usually the button to cancel/deny by pressing one of the key or buttons" + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "EnableEscape", + "True", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Escape" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"B\"", + "" ] } ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Once" + }, + "parameters": [] + } + ], + "actions": [ + { + "type": { + "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::SetActiveButtonById" + }, + "parameters": [ + "Object", + "=", + "1", + "" + ] } ] } - ], + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onHotReloading", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], "actions": [ { "type": { - "value": "SetReturnBoolean" + "value": "TextContainerCapability::TextContainerBehavior::SetValue" }, "parameters": [ - "True" + "Object", + "Text", + "=", + "TextMessage" ] } ] @@ -632,11 +784,11 @@ "objectGroups": [] }, { - "description": "Check if the \"No\" button of the dialog was selected.", - "fullName": "\"No\" button is clicked", + "description": "Check if the \"Yes\" button of the dialog was selected.", + "fullName": "\"Yes\" button is clicked", "functionType": "Condition", - "name": "IsNoClicked", - "sentence": "\"No\" button of _PARAM0_ is clicked", + "name": "IsYesClicked", + "sentence": "\"Yes\" button of _PARAM0_ is clicked", "events": [ { "type": "BuiltinCommonInstructions::Comment", @@ -664,19 +816,10 @@ "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" }, "parameters": [ - "NoButton", + "YesButton", "" ] }, - { - "type": { - "value": "KeyPressed" - }, - "parameters": [ - "", - "Escape" - ] - }, { "type": { "value": "BuiltinCommonInstructions::And" @@ -690,7 +833,7 @@ "parameters": [ "Object", "=", - "1", + "0", "" ] }, @@ -720,168 +863,47 @@ }, { "type": { - "value": "Gamepads::C_Button_pressed" + "value": "KeyPressed" }, "parameters": [ "", - "1", - "\"A\"", - "" + "Space" ] }, { "type": { - "value": "KeyPressed" + "value": "Gamepads::C_Button_pressed" }, "parameters": [ "", - "Space" - ] - } - ] - } - ] - } - ] - } - ], - "actions": [ - { - "type": { - "value": "SetReturnBoolean" - }, - "parameters": [ - "True" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "description": "the highlighted button.", - "fullName": "Highlighted button", - "functionType": "ExpressionAndCondition", - "group": "Dialog Box configuration", - "name": "ActiveButtonById", - "private": true, - "sentence": "the highlighted button", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnNumber" - }, - "parameters": [ - "ActiveButtonById" - ] - } - ] - } - ], - "expressionType": { - "type": "expression" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "ActiveButtonById", - "name": "SetActiveButtonById", - "private": true, - "sentence": "", - "events": [ - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetNumberVariable" - }, - "parameters": [ - "ActiveButtonById", - "=", - "mod(Value, SceneInstancesCount(Buttons))" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Buttons", - "ID", - "=", - "ActiveButtonById" - ] - } - ], - "actions": [ - { - "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" - }, - "parameters": [ - "Buttons", - "Effect", - "\"OutlineEffect\"", - "yes" - ] - } - ] - }, - { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [ - { - "type": { - "value": "VarObjet" - }, - "parameters": [ - "Buttons", - "ID", - "!=", - "ActiveButtonById" + "1", + "\"A\"", + "" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Space" + ] + } + ] + } + ] + } ] } ], "actions": [ { "type": { - "value": "EffectCapability::EffectBehavior::EnableEffect" + "value": "SetReturnBoolean" }, "parameters": [ - "Buttons", - "Effect", - "\"OutlineEffect\"", - "no" + "True" ] } ] @@ -898,560 +920,419 @@ "objectGroups": [] }, { - "description": "the text shown by the dialog.", - "fullName": "Text message", - "functionType": "ExpressionAndCondition", - "group": "Dialog Box configuration", - "name": "TextMessage", - "private": true, - "sentence": "the text", + "description": "Check if the \"No\" button of the dialog was selected.", + "fullName": "\"No\" button is clicked", + "functionType": "Condition", + "name": "IsNoClicked", + "sentence": "\"No\" button of _PARAM0_ is clicked", "events": [ { - "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetReturnString" - }, - "parameters": [ - "TextMessage" - ] - } - ] - } - ], - "expressionType": { - "type": "string" - }, - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - }, - { - "fullName": "", - "functionType": "ActionWithOperator", - "getterName": "TextMessage", - "name": "SetTextMessage", - "private": true, - "sentence": "", - "events": [ + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The button is clicked\nOr\nThe button is active and a key is pressed to validate the button" + }, { "type": "BuiltinCommonInstructions::Standard", - "conditions": [], - "actions": [ - { - "type": { - "value": "SetStringVariable" - }, - "parameters": [ - "TextMessage", - "=", - "Value" - ] - }, + "conditions": [ { "type": { - "value": "TextContainerCapability::TextContainerBehavior::SetValue" + "value": "BuiltinCommonInstructions::Or" }, - "parameters": [ - "Dialogue", - "Text", - "=", - "TextMessage" - ] - } - ] - } - ], - "parameters": [ - { - "description": "Object", - "name": "Object", - "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", - "type": "object" - } - ], - "objectGroups": [] - } - ], - "propertyDescriptors": [ - { - "value": "Default message. Continue?", - "type": "String", - "label": "Message", - "description": "", - "group": "", - "extraInformation": [], - "name": "TextMessage" - }, - { - "value": "0", - "type": "Number", - "unit": "Dimensionless", - "label": "Default highlighted button identifier", - "description": "Default highlighted button identifier.", - "group": "", - "extraInformation": [], - "deprecated": true, - "name": "ActiveButtonById" - }, - { - "value": "true", - "type": "Boolean", - "label": "Cancel with Escape key", - "description": "Enable or disable the escape key to close the dialog.", - "group": "", - "extraInformation": [], - "name": "EnableEscape" - }, - { - "value": "Yes", - "type": "String", - "label": "Label for the \"Yes\" button", - "description": "This is the button with identifier 0.", - "group": "", - "extraInformation": [], - "name": "LabelButtonID0" - }, - { - "value": "No", - "type": "String", - "label": "Label for the \"No\" button", - "description": "This is the button with identifier 1.", - "group": "", - "extraInformation": [], - "name": "LabelButtonID1" - } - ], - "objects": [ - { - "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", - "name": "NoButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variables": [ - { - "name": "ID", - "type": "number", - "value": 0 - } - ], - "effects": [ - { - "effectType": "Outline", - "name": "OutlineEffect", - "doubleParameters": { - "padding": 0, - "thickness": 2 - }, - "stringParameters": { - "color": "255;255;255" - }, - "booleanParameters": {} + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "PanelSpriteButton::PanelSpriteButton::IsClicked" + }, + "parameters": [ + "NoButton", + "" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Escape" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::And" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "TwoChoicesDialogBoxes::TwoChoicesDialogBox::ActiveButtonById" + }, + "parameters": [ + "Object", + "=", + "1", + "" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::Or" + }, + "parameters": [], + "subInstructions": [ + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "NumpadReturn" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Return" + ] + }, + { + "type": { + "value": "Gamepads::C_Button_pressed" + }, + "parameters": [ + "", + "1", + "\"A\"", + "" + ] + }, + { + "type": { + "value": "KeyPressed" + }, + "parameters": [ + "", + "Space" + ] + } + ] + } + ] + } + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] } ], - "behaviors": [ + "parameters": [ { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 0, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } ], - "content": { - "LeftPadding": 8, - "RightPadding": 8, - "PressedLabelOffsetY": 0, - "IdleLabelOffsetY": -8, - "BottomPadding": 8, - "TopPadding": 8, - "MinimalWidth": 300 - }, - "childrenContent": { - "Hovered": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - }, - "Idle": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border.png", - "tiled": true, - "topMargin": 8, - "width": 256 - }, - "Label": { - "bold": false, - "italic": false, - "smoothed": true, - "underlined": false, - "string": "No", - "font": "", - "textAlignment": "center", - "characterSize": 26, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "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": "No", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 26, - "color": "255;255;255" - } - }, - "Pressed": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - } - } + "objectGroups": [] }, { - "assetStoreId": "90d94b6e3a23c34948e59eaaef4679740f8ab588696d59b21e0c0c2ef106b94d", - "name": "YesButton", - "type": "PanelSpriteButton::PanelSpriteButton", - "variables": [ + "description": "the highlighted button.", + "fullName": "Highlighted button", + "functionType": "ExpressionAndCondition", + "group": "Dialog Box configuration", + "name": "ActiveButtonById", + "private": true, + "sentence": "the highlighted button", + "events": [ { - "name": "ID", - "type": "number", - "value": 0 + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ActiveButtonById" + ] + } + ] } ], - "effects": [ + "expressionType": { + "type": "expression" + }, + "parameters": [ { - "effectType": "Outline", - "name": "OutlineEffect", - "doubleParameters": { - "padding": 0, - "thickness": 2 - }, - "stringParameters": { - "color": "255;255;255" - }, - "booleanParameters": {} + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } ], - "behaviors": [ + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "ActiveButtonById", + "name": "SetActiveButtonById", + "private": true, + "sentence": "", + "events": [ { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 0, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 0, - "useLegacyBottomAndRightAnchors": false - } - ], - "content": { - "LeftPadding": 8, - "RightPadding": 8, - "PressedLabelOffsetY": 0, - "IdleLabelOffsetY": -8, - "BottomPadding": 8, - "TopPadding": 8, - "MinimalWidth": 300 - }, - "childrenContent": { - "Hovered": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - }, - "Idle": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border.png", - "tiled": true, - "topMargin": 8, - "width": 256 + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ActiveButtonById", + "=", + "mod(Value, SceneInstancesCount(Buttons))" + ] + } + ] }, - "Label": { - "bold": false, - "italic": false, - "smoothed": true, - "underlined": false, - "string": "Yes", - "font": "", - "textAlignment": "center", - "characterSize": 26, - "color": { - "b": 255, - "g": 255, - "r": 255 - }, - "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": "Yes", - "font": "", - "textAlignment": "center", - "verticalTextAlignment": "top", - "characterSize": 26, - "color": "255;255;255" - } + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Buttons", + "ID", + "=", + "ActiveButtonById" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Buttons", + "Effect", + "\"OutlineEffect\"", + "yes" + ] + } + ] }, - "Pressed": { - "bottomMargin": 8, - "height": 106, - "leftMargin": 8, - "rightMargin": 8, - "texture": "Border2.png", - "tiled": true, - "topMargin": 8, - "width": 256 - } - } - }, - { - "assetStoreId": "", - "bottomMargin": 16, - "height": 48, - "leftMargin": 16, - "name": "TextBorder", - "rightMargin": 16, - "texture": "Border.png", - "tiled": true, - "topMargin": 16, - "type": "PanelSpriteObject::PanelSprite", - "width": 48, - "variables": [], - "effects": [], - "behaviors": [ { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "VarObjet" + }, + "parameters": [ + "Buttons", + "ID", + "!=", + "ActiveButtonById" + ] + } + ], + "actions": [ + { + "type": { + "value": "EffectCapability::EffectBehavior::EnableEffect" + }, + "parameters": [ + "Buttons", + "Effect", + "\"OutlineEffect\"", + "no" + ] + } + ] } - ] - }, - { - "assetStoreId": "", - "name": "Dialogue", - "type": "BitmapText::BitmapTextObject", - "variables": [], - "effects": [], - "behaviors": [ - { - "name": "Anchor", - "type": "AnchorBehavior::AnchorBehavior", - "bottomEdgeAnchor": 2, - "leftEdgeAnchor": 1, - "relativeToOriginalWindowSize": true, - "rightEdgeAnchor": 2, - "topEdgeAnchor": 1, - "useLegacyBottomAndRightAnchors": false + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } ], - "content": { - "text": "Default message. Continue?", - "opacity": 255, - "scale": 2, - "fontSize": 20, - "tint": "255;255;255", - "bitmapFontResourceName": "8BitOperatorPlus8Regular_Edited.fnt", - "textureAtlasResourceName": "8BitOperatorPlus8Regular_Edited.png", - "align": "left", - "wordWrap": true - } - } - ], - "objectsFolderStructure": { - "folderName": "__ROOT", - "children": [ - { - "objectName": "Dialogue" - }, - { - "objectName": "TextBorder" - }, - { - "objectName": "YesButton" - }, - { - "objectName": "NoButton" - } - ] - }, - "objectsGroups": [ + "objectGroups": [] + }, { - "name": "Buttons", - "objects": [ + "description": "the text shown by the dialog.", + "fullName": "Text message", + "functionType": "ExpressionAndCondition", + "group": "Dialog Box configuration", + "name": "TextMessage", + "private": true, + "sentence": "the text", + "events": [ { - "name": "NoButton" - }, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "TextMessage" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [ { - "name": "YesButton" + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" } - ] - } - ], - "layers": [ + ], + "objectGroups": [] + }, { - "ambientLightColorB": 200, - "ambientLightColorG": 200, - "ambientLightColorR": 200, - "camera3DFarPlaneDistance": 10000, - "camera3DFieldOfView": 45, - "camera3DNearPlaneDistance": 3, - "cameraType": "", - "followBaseLayerCamera": false, - "isLightingLayer": false, - "isLocked": false, - "name": "", - "renderingType": "", - "visibility": true, - "cameras": [ + "fullName": "", + "functionType": "ActionWithOperator", + "getterName": "TextMessage", + "name": "SetTextMessage", + "private": true, + "sentence": "", + "events": [ { - "defaultSize": true, - "defaultViewport": true, - "height": 0, - "viewportBottom": 1, - "viewportLeft": 0, - "viewportRight": 1, - "viewportTop": 0, - "width": 0 + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "TextMessage", + "=", + "Value" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "Dialogue", + "Text", + "=", + "TextMessage" + ] + } + ] } ], - "effects": [] + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "TwoChoicesDialogBoxes::TwoChoicesDialogBox", + "type": "object" + } + ], + "objectGroups": [] } ], - "instances": [ + "propertyDescriptors": [ { - "angle": 0, - "customSize": true, - "depth": 1, - "height": 124, - "layer": "", - "name": "Dialogue", - "persistentUuid": "c7183394-9ca6-4c16-9d13-f0b7cfe803d8", - "width": 554, - "x": 19, - "y": 18, - "zOrder": 45, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "value": "Default message. Continue?", + "type": "String", + "label": "Message", + "description": "", + "group": "", + "extraInformation": [], + "name": "TextMessage" }, { - "angle": 0, - "customSize": true, - "depth": 0, - "height": 213, - "layer": "", - "name": "TextBorder", - "persistentUuid": "639d5661-817d-4faa-b33b-c0ff129c309a", - "width": 600, - "x": 0, - "y": 0, - "zOrder": 43, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "value": "0", + "type": "Number", + "unit": "Dimensionless", + "label": "Default highlighted button identifier", + "description": "Default highlighted button identifier.", + "group": "", + "extraInformation": [], + "deprecated": true, + "name": "ActiveButtonById" }, { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 36, - "layer": "", - "name": "YesButton", - "persistentUuid": "a0ca78d3-0a23-4bbe-89de-fb2d0a53996c", - "width": 105, - "x": 350, - "y": 160, - "zOrder": 510, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [] + "value": "true", + "type": "Boolean", + "label": "Cancel with Escape key", + "description": "Enable or disable the escape key to close the dialog.", + "group": "", + "extraInformation": [], + "name": "EnableEscape" }, { - "angle": 0, - "customSize": true, - "depth": 32, - "height": 36, - "layer": "", - "name": "NoButton", - "persistentUuid": "6781aafa-3ae9-4820-bb97-682a524a0cf6", - "width": 103, - "x": 471, - "y": 160, - "zOrder": 510, - "numberProperties": [], - "stringProperties": [], - "initialVariables": [ - { - "name": "ID", - "persistentUuid": "bb563dbe-93eb-4412-b843-f60016b9a893", - "type": "number", - "value": 1 - } - ] + "value": "Yes", + "type": "String", + "label": "Label for the \"Yes\" button", + "description": "This is the button with identifier 0.", + "group": "", + "extraInformation": [], + "name": "LabelButtonID0" + }, + { + "value": "No", + "type": "String", + "label": "Label for the \"No\" button", + "description": "This is the button with identifier 1.", + "group": "", + "extraInformation": [], + "name": "LabelButtonID1" + }, + { + "value": "", + "type": "Choice", + "label": "", + "description": "", + "group": "", + "extraInformation": [ + "YesButton.LabelText=LabelButtonID0", + "NoButton.LabelText=LabelButtonID1", + "Dialogue.Text=TextMessage" + ], + "hidden": true, + "name": "_PropertyMapping" } - ] + ], + "variants": [] } ] } \ No newline at end of file