From c78aae1cb07e9ff3c84e7cf498aeda0d741c0b07 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 14:44:46 +0000 Subject: [PATCH] Add Speedometer and GoalProgressBar extensions --- extensions/community/GoalProgressBar.json | 1473 +++++++++++++++++++++ extensions/community/Speedometer.json | 967 ++++++++++++++ 2 files changed, 2440 insertions(+) create mode 100644 extensions/community/GoalProgressBar.json create mode 100644 extensions/community/Speedometer.json diff --git a/extensions/community/GoalProgressBar.json b/extensions/community/GoalProgressBar.json new file mode 100644 index 000000000..9101d6e72 --- /dev/null +++ b/extensions/community/GoalProgressBar.json @@ -0,0 +1,1473 @@ +{ + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Goal progress bar", + "gdevelopVersion": ">=5.5.230", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjEzIiB3aWR0aD0iMjYiIGhlaWdodD0iOCIgcng9IjIiLz48cGF0aCBkPSJNMTIgMTN2OE0yMCAxM3Y4Ii8+PHBhdGggZD0iTTE0IDlsMyAzIDMtM3oiIGZpbGw9IiMwMDAiLz48cGF0aCBkPSJNMjcgNXY4TTI3IDVoLTRsMSAxLjUtMSAxLjVoNCIvPjwvZz48L3N2Zz4=", + "name": "GoalProgressBar", + "previewIconUrl": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxyZWN0IHg9IjMiIHk9IjEzIiB3aWR0aD0iMjYiIGhlaWdodD0iOCIgcng9IjIiLz48cGF0aCBkPSJNMTIgMTN2OE0yMCAxM3Y4Ii8+PHBhdGggZD0iTTE0IDlsMyAzIDMtM3oiIGZpbGw9IiMwMDAiLz48cGF0aCBkPSJNMjcgNXY4TTI3IDVoLTRsMSAxLjUtMSAxLjVoNCIvPjwvZz48L3N2Zz4=", + "shortDescription": "A bar from a start to a goal, with a marker at the progress and checkpoints, for races, levels and quests.", + "version": "1.0.0", + "description": [ + "Show how far the player is from the goal: the distance driven in a race, the progress in a level, the steps of a quest...", + "", + "Change its value with the action \"Value\" (from 0 to the maximum value): the bar fills, the marker slides to the progress and the checkpoints passed change. The bar is cut in sections (the \"Number of sections\" property), and its start and goal labels are properties.", + "", + "Ready-to-use goal progress bars are in the asset store [goal progress bars pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=goal-progress-bars-goal-progress-bars)." + ], + "origin": { + "identifier": "GoalProgressBar", + "name": "gdevelop-extension-store" + }, + "tags": [ + "progress", + "goal", + "progress bar", + "race", + "distance", + "checkpoint", + "level", + "hud", + "ui" + ], + "authorIds": [ + "R0F5QGNCzgOY5w2cxGeKJOq2UaD2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 600, + "areaMaxY": 40, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "assetStoreTag": "goal progress bars", + "defaultName": "GoalProgressBar", + "description": "A bar from a start to a goal with a marker at the progress, cut in sections by checkpoints: the progress in a race, a level, a quest...", + "fullName": "Goal progress bar", + "isInnerAreaFollowingParentSize": true, + "isUsingLegacyInstancesRenderer": false, + "name": "GoalProgressBar", + "objects": [ + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 32, + "leftMargin": 0, + "name": "Track", + "rightMargin": 0, + "texture": "", + "tiled": false, + "type": "PanelSpriteObject::PanelSprite", + "width": 400, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ] + }, + { + "assetStoreId": "", + "bottomMargin": 0, + "height": 24, + "leftMargin": 0, + "name": "Fill", + "rightMargin": 0, + "texture": "", + "tiled": false, + "type": "PanelSpriteObject::PanelSprite", + "width": 400, + "variables": [], + "effects": [], + "behaviors": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Checkpoint", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "Index", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Marker", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "GoalIcon", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 2, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ], + "animations": [] + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "StartLabel", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 1, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 1, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "START", + "font": "", + "textAlignment": "right", + "characterSize": 24, + "color": { + "r": 0, + "g": 0, + "b": 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": "START", + "font": "", + "textAlignment": "right", + "verticalTextAlignment": "center", + "characterSize": 24, + "lineHeight": 0, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "GoalLabel", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [ + { + "name": "Anchor", + "type": "AnchorBehavior::AnchorBehavior", + "bottomEdgeAnchor": 4, + "leftEdgeAnchor": 2, + "relativeToOriginalWindowSize": true, + "rightEdgeAnchor": 2, + "topEdgeAnchor": 4, + "useLegacyBottomAndRightAnchors": false + } + ], + "string": "GOAL", + "font": "", + "textAlignment": "left", + "characterSize": 24, + "color": { + "r": 0, + "g": 0, + "b": 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": "GOAL", + "font": "", + "textAlignment": "left", + "verticalTextAlignment": "center", + "characterSize": 24, + "lineHeight": 0, + "color": "0;0;0" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Track" + }, + { + "objectName": "Fill" + }, + { + "objectName": "Checkpoint" + }, + { + "objectName": "Marker" + }, + { + "objectName": "GoalIcon" + }, + { + "objectName": "StartLabel" + }, + { + "objectName": "GoalLabel" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "height": 32, + "layer": "", + "name": "StartLabel", + "persistentUuid": "6c35feb3-50cb-48e7-89e7-457b9cedc9ad", + "width": 90, + "x": 0, + "y": 4, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 40, + "layer": "", + "name": "Track", + "persistentUuid": "d1cfed51-bc5e-406b-8f79-ae438b376aa0", + "width": 400, + "x": 100, + "y": 0, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 28, + "layer": "", + "name": "Fill", + "persistentUuid": "a2509c5a-6bcb-4582-97d2-545886612951", + "width": 388, + "x": 106, + "y": 6, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 32, + "layer": "", + "name": "Checkpoint", + "persistentUuid": "66e883af-76d5-4e41-b32b-ab7ee3c507e2", + "width": 4, + "x": 196, + "y": 4, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 48, + "layer": "", + "name": "Marker", + "persistentUuid": "a2a6e097-bafd-45bf-8400-6a14a4d7ce09", + "width": 48, + "x": 90, + "y": -4, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 32, + "layer": "", + "name": "GoalLabel", + "persistentUuid": "f52fae8c-87c3-4c51-ab4b-ef45de6ddf98", + "width": 90, + "x": 510, + "y": 4, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "Value", + "name": "Value", + "description": "The progress, from 0 to the maximum value (for example the distance driven, or the number of checkpoints passed).", + "unit": "Dimensionless" + }, + { + "value": "100", + "type": "Number", + "label": "Maximum value", + "name": "MaxValue", + "description": "The value at the goal.", + "unit": "Dimensionless" + }, + { + "value": "4", + "type": "Number", + "label": "Number of sections", + "name": "CheckpointCount", + "description": "The bar is cut in this number of sections, with a checkpoint between them (1 for no checkpoint).", + "unit": "Dimensionless" + }, + { + "value": "6", + "type": "Number", + "label": "Smoothing", + "name": "Smoothing", + "description": "How fast the bar follows a new value (0 to follow it instantly).", + "unit": "Dimensionless" + }, + { + "value": "START", + "type": "String", + "label": "Start label", + "name": "StartText" + }, + { + "value": "GOAL", + "type": "String", + "label": "Goal label", + "name": "GoalText" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "ShownRatio", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "FillLeft", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "FillRight", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "FillY", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "FillHeight", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "MarkerY", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "CheckpointY", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "CheckpointWidth", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "CheckpointHeight", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "Index", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "LayoutWidth", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "name": "HasCheckpointModel", + "hidden": true + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The fill, the marker and the checkpoints are placed in the variant: their position is kept relative to the track (which is resized with the object)." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FillLeft", + "=", + "Fill.X() - Track.X()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FillRight", + "=", + "Track.X() + Track.Width() - Fill.X() - Fill.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FillY", + "=", + "Fill.Y() - Track.Y()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "FillHeight", + "=", + "Fill.Height()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MarkerY", + "=", + "Marker.Y() - Track.Y()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneInstancesCount" + }, + "parameters": [ + "", + "Checkpoint", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "HasCheckpointModel", + "True", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CheckpointY", + "=", + "Checkpoint.Y() - Track.Y()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CheckpointWidth", + "=", + "Checkpoint.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CheckpointHeight", + "=", + "Checkpoint.Height()" + ] + }, + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Checkpoint", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "StartLabel", + "Text", + "=", + "StartText" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "GoalLabel", + "Text", + "=", + "GoalText" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ShownRatio", + "=", + "clamp(Value / max(0.0001, MaxValue), 0, 1)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "GoalProgressBar::GoalProgressBar::Update" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update the layout", + "functionType": "Action", + "name": "UpdateLayout", + "sentence": "Update the layout of _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "One checkpoint between each section." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Delete" + }, + "parameters": [ + "Checkpoint", + "" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "LayoutWidth", + "=", + "Object.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CheckpointCount", + "=", + "max(1, round(CheckpointCount))" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "HasCheckpointModel", + "True", + "" + ] + } + ], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Repeat", + "repeatExpression": "CheckpointCount - 1", + "conditions": [], + "actions": [ + { + "type": { + "value": "Create" + }, + "parameters": [ + "", + "Checkpoint", + "Track.X() + FillLeft + max(1, Track.Width() - FillLeft - FillRight) * Index / CheckpointCount - CheckpointWidth / 2", + "Track.Y() + CheckpointY", + "" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetSize" + }, + "parameters": [ + "Checkpoint", + "Resizable", + "CheckpointWidth", + "CheckpointHeight" + ] + }, + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Checkpoint", + "Index", + "=", + "Index" + ] + }, + { + "type": { + "value": "SetZOrder" + }, + "parameters": [ + "Checkpoint", + "=", + "3" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Index", + "+", + "1" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "description": "Place the checkpoints.", + "private": true + }, + { + "fullName": "Update", + "functionType": "Action", + "name": "Update", + "sentence": "Update _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "LayoutWidth", + "!=", + "Object.Width()" + ] + } + ], + "actions": [ + { + "type": { + "value": "GoalProgressBar::GoalProgressBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Smoothing", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ShownRatio", + "=", + "clamp(Value / max(0.0001, MaxValue), 0, 1)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Smoothing", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ShownRatio", + "+", + "(clamp(Value / max(0.0001, MaxValue), 0, 1) - ShownRatio) * min(1, Smoothing * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Fill", + "=", + "Track.X() + FillLeft", + "=", + "Track.Y() + FillY" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetSize" + }, + "parameters": [ + "Fill", + "Resizable", + "max(1, Track.Width() - FillLeft - FillRight) * ShownRatio", + "FillHeight" + ] + }, + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Marker", + "=", + "Track.X() + FillLeft + max(1, Track.Width() - FillLeft - FillRight) * ShownRatio - Marker.Width() / 2", + "=", + "Track.Y() + MarkerY" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "An empty fill is hidden: a panel narrower than its borders would not be drawn correctly." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Fill.Width()", + "<", + "max(2, FillHeight / 2)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Fill" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Fill.Width()", + ">=", + "max(2, FillHeight / 2)" + ] + } + ], + "actions": [ + { + "type": { + "value": "Show" + }, + "parameters": [ + "Fill" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The checkpoints passed change to their second animation." + }, + { + "type": "BuiltinCommonInstructions::ForEach", + "object": "Checkpoint", + "conditions": [], + "actions": [], + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Checkpoint.Index / CheckpointCount", + "<=", + "ShownRatio + 0.0001" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Checkpoint", + "Animation", + "=", + "1" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Checkpoint.Index / CheckpointCount", + ">", + "ShownRatio + 0.0001" + ] + } + ], + "actions": [ + { + "type": { + "value": "AnimatableCapability::AnimatableBehavior::SetIndex" + }, + "parameters": [ + "Checkpoint", + "Animation", + "=", + "0" + ] + } + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "description": "Move the fill and the marker.", + "private": true + }, + { + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "name": "Value", + "sentence": "the progress", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "description": "the progress.", + "expressionType": { + "type": "number" + } + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Value", + "=", + "clamp(Value, 0, MaxValue)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "getterName": "Value" + }, + { + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "name": "MaxValue", + "sentence": "the maximum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MaxValue" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "description": "the value at the goal.", + "expressionType": { + "type": "number" + } + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "name": "SetMaxValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MaxValue", + "=", + "max(0.0001, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "getterName": "MaxValue" + }, + { + "fullName": "Progress", + "functionType": "Expression", + "name": "Progress", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "clamp(Value / max(0.0001, MaxValue), 0, 1)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "description": "The progress, from 0 (start) to 1 (goal).", + "expressionType": { + "type": "number" + } + }, + { + "fullName": "Goal is reached", + "functionType": "Condition", + "name": "IsComplete", + "sentence": "The goal of _PARAM0_ is reached", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Value", + ">=", + "MaxValue" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + } + ], + "objectGroups": [], + "description": "Check if the value reached the maximum value." + }, + { + "fullName": "Number of sections", + "functionType": "Action", + "name": "SetCheckpointCount", + "sentence": "Change the number of sections of _PARAM0_ to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "CheckpointCount", + "=", + "max(1, round(Value))" + ] + }, + { + "type": { + "value": "GoalProgressBar::GoalProgressBar::UpdateLayout" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "GoalProgressBar::GoalProgressBar", + "type": "object" + }, + { + "description": "Number of sections", + "name": "Value", + "type": "expression" + } + ], + "objectGroups": [], + "description": "Change the number of sections of the bar (a checkpoint is shown between them)." + } + ] + } + ] +} \ No newline at end of file diff --git a/extensions/community/Speedometer.json b/extensions/community/Speedometer.json new file mode 100644 index 000000000..154788a7d --- /dev/null +++ b/extensions/community/Speedometer.json @@ -0,0 +1,967 @@ +{ + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Speedometer", + "gdevelopVersion": ">=5.5.230", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTUgMjQgQTEyIDEyIDAgMSAxIDI3IDI0Ii8+PHBhdGggZD0iTTE2IDE4IEwyMyAxMCIvPjxwYXRoIGQ9Ik04IDE3aDJNMTYgOHYyTTI0IDE3aC0yTTEwLjUgMTEuNWwxLjQgMS40Ii8+PC9nPjxjaXJjbGUgY3g9IjE2IiBjeT0iMTgiIHI9IjIuNSIvPjwvc3ZnPg==", + "name": "Speedometer", + "previewIconUrl": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTUgMjQgQTEyIDEyIDAgMSAxIDI3IDI0Ii8+PHBhdGggZD0iTTE2IDE4IEwyMyAxMCIvPjxwYXRoIGQ9Ik04IDE3aDJNMTYgOHYyTTI0IDE3aC0yTTEwLjUgMTEuNWwxLjQgMS40Ii8+PC9nPjxjaXJjbGUgY3g9IjE2IiBjeT0iMTgiIHI9IjIuNSIvPjwvc3ZnPg==", + "shortDescription": "A speedometer (or any gauge) with a needle, a digital value and a segmented bar.", + "version": "1.0.0", + "description": [ + "A speedometer for racing and driving games, or any gauge (rpm, fuel, temperature...).", + "", + "Change its value with the action \"Value\" (for example to the speed of a car): the needle turns, the digital value and the segmented bar change, smoothly. The maximum value should match the numbers drawn on its dial, and the unit (\"km/h\", \"mph\"...) is a property.", + "", + "Ready-to-use speedometers are in the asset store [speedometers pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=speedometers-speedometers)." + ], + "origin": { + "identifier": "Speedometer", + "name": "gdevelop-extension-store" + }, + "tags": [ + "speedometer", + "gauge", + "dial", + "needle", + "speed", + "racing", + "car", + "hud", + "ui" + ], + "authorIds": [ + "R0F5QGNCzgOY5w2cxGeKJOq2UaD2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 240, + "areaMaxY": 240, + "areaMaxZ": 64, + "areaMinX": 0, + "areaMinY": 0, + "areaMinZ": 0, + "assetStoreTag": "speedometers", + "defaultName": "Speedometer", + "description": "A speedometer (or any gauge): a needle on a dial, a digital value and a segmented bar, that follow the value smoothly.", + "fullName": "Speedometer", + "isInnerAreaFollowingParentSize": false, + "isUsingLegacyInstancesRenderer": false, + "name": "Speedometer", + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Dial", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "assetStoreId": "", + "name": "BarBackground", + "type": "TiledSpriteObject::TiledSprite", + "variables": [], + "effects": [], + "behaviors": [], + "texture": "", + "width": 32, + "height": 32 + }, + { + "assetStoreId": "", + "name": "Bar", + "type": "TiledSpriteObject::TiledSprite", + "variables": [], + "effects": [], + "behaviors": [], + "texture": "", + "width": 32, + "height": 32 + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Needle", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Hub", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "ValueText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "0", + "font": "", + "textAlignment": "center", + "characterSize": 48, + "color": { + "r": 0, + "g": 0, + "b": 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": "0", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 48, + "lineHeight": 0, + "color": "0;0;0" + } + }, + { + "assetStoreId": "", + "bold": false, + "italic": false, + "name": "UnitText", + "smoothed": true, + "type": "TextObject::Text", + "underlined": false, + "variables": [], + "effects": [], + "behaviors": [], + "string": "km/h", + "font": "", + "textAlignment": "center", + "characterSize": 20, + "color": { + "r": 0, + "g": 0, + "b": 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": "km/h", + "font": "", + "textAlignment": "center", + "verticalTextAlignment": "center", + "characterSize": 20, + "lineHeight": 0, + "color": "0;0;0" + } + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Dial" + }, + { + "objectName": "BarBackground" + }, + { + "objectName": "Bar" + }, + { + "objectName": "Needle" + }, + { + "objectName": "Hub" + }, + { + "objectName": "ValueText" + }, + { + "objectName": "UnitText" + } + ] + }, + "objectsGroups": [], + "layers": [ + { + "ambientLightColorB": 200, + "ambientLightColorG": 200, + "ambientLightColorR": 200, + "camera2DPlaneMaxDrawingDistance": 5000, + "camera3DFarPlaneDistance": 10000, + "camera3DFieldOfView": 45, + "camera3DNearPlaneDistance": 3, + "cameraType": "", + "followBaseLayerCamera": false, + "isLightingLayer": false, + "isLocked": false, + "name": "", + "renderingType": "", + "visibility": true, + "cameras": [ + { + "defaultSize": true, + "defaultViewport": true, + "height": 0, + "viewportBottom": 1, + "viewportLeft": 0, + "viewportRight": 1, + "viewportTop": 0, + "width": 0 + } + ], + "effects": [] + } + ], + "instances": [ + { + "angle": 0, + "customSize": true, + "height": 240, + "layer": "", + "name": "Dial", + "persistentUuid": "2ceabaef-207a-47f4-8275-0dd60eed3dc2", + "width": 240, + "x": 0, + "y": 0, + "zOrder": 0, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 16, + "layer": "", + "name": "Needle", + "persistentUuid": "520c2fd8-4aa7-40f6-a8fd-f35fcd5644b7", + "width": 100, + "x": 120, + "y": 120, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 32, + "layer": "", + "name": "Hub", + "persistentUuid": "43a4ed5b-9a4f-4a9d-a96a-43311e65391b", + "width": 32, + "x": 104, + "y": 104, + "zOrder": 3, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 50, + "layer": "", + "name": "ValueText", + "persistentUuid": "2b8bbafb-e5a7-49e6-96a8-8dbe37156c39", + "width": 100, + "x": 70, + "y": 150, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 24, + "layer": "", + "name": "UnitText", + "persistentUuid": "f5695719-6c99-48a9-954f-1103236b664c", + "width": 100, + "x": 70, + "y": 196, + "zOrder": 4, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "propertyDescriptors": [ + { + "value": "0", + "type": "Number", + "label": "Value", + "name": "Value", + "description": "The speed (or the value) shown.", + "unit": "Dimensionless" + }, + { + "value": "240", + "type": "Number", + "label": "Maximum value", + "name": "MaxValue", + "description": "The value at the end of the dial (it should match the numbers drawn on the dial).", + "unit": "Dimensionless" + }, + { + "value": "km/h", + "type": "String", + "label": "Unit", + "name": "Unit", + "description": "Shown under the value, for example \"km/h\", \"mph\" or \"rpm\"." + }, + { + "value": "0", + "type": "Number", + "label": "Decimals of the value", + "name": "Decimals", + "unit": "Dimensionless" + }, + { + "value": "8", + "type": "Number", + "label": "Needle smoothing", + "name": "Smoothing", + "description": "How fast the needle and the value follow a new value (0 to follow it instantly).", + "group": "Needle", + "unit": "Dimensionless" + }, + { + "value": "135", + "type": "Number", + "label": "Needle angle at 0", + "name": "MinAngle", + "description": "The angle of the needle at 0 (0 is to the right, 90 is down).", + "group": "Needle", + "unit": "DegreeAngle" + }, + { + "value": "405", + "type": "Number", + "label": "Needle angle at the maximum value", + "name": "MaxAngle", + "description": "The angle of the needle at the maximum value: more than the angle at 0 to turn clockwise.", + "group": "Needle", + "unit": "DegreeAngle" + }, + { + "value": "0", + "type": "Number", + "label": "Number of segments of the bar", + "name": "BarSegmentCount", + "description": "The bar is filled segment by segment (0 to fill it smoothly). It should match the number of segments drawn on the bar image.", + "group": "Bar", + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "ShownValue", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "BarFullWidth", + "hidden": true, + "unit": "Dimensionless" + } + ], + "eventsFunctions": [ + { + "fullName": "", + "functionType": "Action", + "name": "onCreated", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneInstancesCount" + }, + "parameters": [ + "", + "Bar", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "BarFullWidth", + "=", + "Bar.Width()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "UnitText", + "Text", + "=", + "Unit" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ShownValue", + "=", + "clamp(Value, 0, MaxValue)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Speedometer::Speedometer::Update" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Speedometer::Speedometer::Update" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Update", + "functionType": "Action", + "name": "Update", + "sentence": "Update _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Smoothing", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ShownValue", + "=", + "clamp(Value, 0, MaxValue)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "Smoothing", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "ShownValue", + "+", + "(clamp(Value, 0, MaxValue) - ShownValue) * min(1, Smoothing * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetAngle" + }, + "parameters": [ + "Needle", + "=", + "MinAngle + (MaxAngle - MinAngle) * ShownValue / max(0.0001, MaxValue)" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "ValueText", + "Text", + "=", + "ToString(roundTo(ShownValue, Decimals))" + ] + }, + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Bar", + "Resizable", + "=", + "BarFullWidth * ShownValue / max(0.0001, MaxValue)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "BarSegmentCount", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetWidth" + }, + "parameters": [ + "Bar", + "Resizable", + "=", + "BarFullWidth * ceil(BarSegmentCount * ShownValue / max(0.0001, MaxValue) - 0.01) / BarSegmentCount" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "An empty bar is hidden (a tiled sprite can not be 0 pixel wide)." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Bar.Width()", + "<", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "Bar" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareNumbers" + }, + "parameters": [ + "Bar.Width()", + ">=", + "1" + ] + } + ], + "actions": [ + { + "type": { + "value": "Show" + }, + "parameters": [ + "Bar" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [], + "description": "Move the needle and the bar, and change the value.", + "private": true + }, + { + "fullName": "Value", + "functionType": "ExpressionAndCondition", + "name": "Value", + "sentence": "the value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [], + "description": "the value (the speed).", + "expressionType": { + "type": "number" + } + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "name": "SetValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Value", + "=", + "Value" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [], + "getterName": "Value" + }, + { + "fullName": "Maximum value", + "functionType": "ExpressionAndCondition", + "name": "MaxValue", + "sentence": "the maximum value", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "MaxValue" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [], + "description": "the maximum value.", + "expressionType": { + "type": "number" + } + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "name": "SetMaxValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "MaxValue", + "=", + "max(0.0001, Value)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [], + "getterName": "MaxValue" + }, + { + "fullName": "Shown value", + "functionType": "Expression", + "name": "ShownValue", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "ShownValue" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + } + ], + "objectGroups": [], + "description": "The value shown by the needle, which follows the value smoothly.", + "expressionType": { + "type": "number" + } + }, + { + "fullName": "Unit", + "functionType": "Action", + "name": "SetUnit", + "sentence": "Change the unit of _PARAM0_ to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Unit", + "=", + "Value" + ] + }, + { + "type": { + "value": "TextContainerCapability::TextContainerBehavior::SetValue" + }, + "parameters": [ + "UnitText", + "Text", + "=", + "Unit" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Speedometer::Speedometer", + "type": "object" + }, + { + "description": "Unit", + "name": "Value", + "type": "string" + } + ], + "objectGroups": [], + "description": "Change the unit shown under the value." + } + ] + } + ] +} \ No newline at end of file