diff --git a/extensions/community/Crosshair.json b/extensions/community/Crosshair.json new file mode 100644 index 000000000..d194c7f46 --- /dev/null +++ b/extensions/community/Crosshair.json @@ -0,0 +1,1353 @@ +{ + "author": "", + "category": "User interface", + "extensionNamespace": "", + "fullName": "Crosshair", + "gdevelopVersion": ">=5.5.230", + "helpPath": "", + "iconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/UI Essentials/UI Essentials_dart_mission_goal_success.svg", + "name": "Crosshair", + "previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/UI Essentials/UI Essentials_dart_mission_goal_success.svg", + "shortDescription": "A crosshair following the mouse or touch, with spread when shooting, a hit marker and a color on targets.", + "version": "1.0.0", + "description": [ + "A crosshair (or a reticle) for shooters. Its position is its center: put it at the cursor, the center of the screen or anywhere without any offset.", + "", + "By default it follows the mouse cursor (or the touch) and hides the mouse cursor. Then, optionally:", + "- **Add spread** when shooting: its arms move apart and come back by themselves (the \"Spread\" expression can make shots less precise),", + "- **Show the hit marker** when a shot hits,", + "- **On a target**: it takes another color while aiming at an enemy.", + "", + "Ready-to-use crosshairs are in the asset store [crosshairs pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=crosshairs-crosshairs)." + ], + "origin": { + "identifier": "Crosshair", + "name": "gdevelop-extension-store" + }, + "tags": [ + "crosshair", + "reticle", + "aim", + "shooter", + "fps", + "cursor", + "hit marker", + "ui" + ], + "authorIds": [ + "R0F5QGNCzgOY5w2cxGeKJOq2UaD2" + ], + "dependencies": [], + "globalVariables": [], + "sceneVariables": [], + "eventsFunctions": [], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [ + { + "areaMaxX": 32.0, + "areaMaxY": 32.0, + "areaMaxZ": 64, + "areaMinX": -32.0, + "areaMinY": -32.0, + "areaMinZ": 0, + "assetStoreTag": "crosshairs", + "defaultName": "Crosshair", + "description": "A crosshair centered on its position, following the mouse or touch. Its arms move apart when shooting, it flashes a hit marker and changes color on a target.", + "fullName": "Crosshair", + "isInnerAreaFollowingParentSize": false, + "isUsingLegacyInstancesRenderer": false, + "name": "Crosshair", + "objects": [ + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Ring", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Arm", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [ + { + "name": "BaseX", + "type": "number", + "value": 0 + }, + { + "name": "BaseY", + "type": "number", + "value": 0 + }, + { + "name": "DirectionX", + "type": "number", + "value": 0 + }, + { + "name": "DirectionY", + "type": "number", + "value": 0 + } + ], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "Center", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + }, + { + "adaptCollisionMaskAutomatically": true, + "assetStoreId": "", + "name": "HitMarker", + "type": "Sprite", + "updateIfNotVisible": false, + "variables": [], + "effects": [], + "behaviors": [], + "animations": [] + } + ], + "objectsFolderStructure": { + "folderName": "__ROOT", + "children": [ + { + "objectName": "Ring" + }, + { + "objectName": "Arm" + }, + { + "objectName": "Center" + }, + { + "objectName": "HitMarker" + } + ] + }, + "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": 14, + "layer": "", + "name": "Arm", + "persistentUuid": "c2dfb1af-d57c-4d1a-833d-fcf81f667f2a", + "width": 6, + "x": -3, + "y": -26, + "zOrder": 1, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + }, + { + "angle": 0, + "customSize": true, + "height": 6, + "layer": "", + "name": "Center", + "persistentUuid": "767067a4-c57e-4c1b-b201-c8991a357c7d", + "width": 6, + "x": -3, + "y": -3, + "zOrder": 2, + "numberProperties": [], + "stringProperties": [], + "initialVariables": [] + } + ], + "propertyDescriptors": [ + { + "value": "255;255;255", + "type": "Color", + "label": "Color", + "name": "Color", + "description": "The tint of the crosshair (its images are white)." + }, + { + "value": "255;64;64", + "type": "Color", + "label": "Color on a target", + "name": "TargetColor", + "description": "The tint of the crosshair when it is on a target (see the action \"On a target\")." + }, + { + "value": "true", + "type": "Boolean", + "label": "Follow the mouse or touch", + "name": "FollowCursor", + "description": "Move the crosshair to the mouse cursor (or the touch) every frame, on its layer." + }, + { + "value": "true", + "type": "Boolean", + "label": "Hide the mouse cursor", + "name": "ShouldHideCursor", + "description": "Hide the mouse cursor while the crosshair exists." + }, + { + "value": "24", + "type": "Number", + "label": "Maximum spread", + "name": "MaxSpread", + "description": "How far the arms can move apart when shooting (in pixels).", + "group": "Spread", + "unit": "Pixel" + }, + { + "value": "60", + "type": "Number", + "label": "Spread recovery speed", + "name": "SpreadRecovery", + "description": "How fast the arms come back after shooting (in pixels per second).", + "group": "Spread", + "unit": "PixelSpeed" + }, + { + "value": "0.25", + "type": "Number", + "label": "Hit marker duration", + "name": "HitMarkerDuration", + "group": "Hit marker", + "unit": "Second" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "Spread", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "", + "type": "Boolean", + "label": "", + "name": "IsOnTarget", + "hidden": true + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "HitMarkerTime", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "RingBaseWidth", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "0", + "type": "Number", + "label": "", + "name": "RingBaseHeight", + "hidden": true, + "unit": "Dimensionless" + }, + { + "value": "", + "type": "String", + "label": "", + "name": "AppliedColor", + "hidden": true + }, + { + "value": "", + "type": "String", + "label": "", + "name": "WantedColor", + "hidden": true + }, + { + "value": "", + "type": "Boolean", + "label": "", + "name": "IsCursorHidden", + "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 arms move apart from the center when the crosshair spreads: each one along the line from the center (the origin of the crosshair) to its own center." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Arm", + "BaseX", + "=", + "Arm.X()" + ] + }, + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Arm", + "BaseY", + "=", + "Arm.Y()" + ] + }, + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Arm", + "DirectionX", + "=", + "Arm.CenterX() / max(0.0001, sqrt(pow(Arm.CenterX(), 2) + pow(Arm.CenterY(), 2)))" + ] + }, + { + "type": { + "value": "SetNumberObjectVariable" + }, + "parameters": [ + "Arm", + "DirectionY", + "=", + "Arm.CenterY() / max(0.0001, sqrt(pow(Arm.CenterX(), 2) + pow(Arm.CenterY(), 2)))" + ] + }, + { + "type": { + "value": "Hide" + }, + "parameters": [ + "HitMarker" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "SceneInstancesCount" + }, + "parameters": [ + "", + "Ring", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RingBaseWidth", + "=", + "Ring.Width()" + ] + }, + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "RingBaseHeight", + "=", + "Ring.Height()" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "ShouldHideCursor", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "HideCursor" + }, + "parameters": [ + "" + ] + }, + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsCursorHidden", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Crosshair::Crosshair::FollowCursorPosition" + }, + "parameters": [ + "Object", + "" + ] + }, + { + "type": { + "value": "Crosshair::Crosshair::Update" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "onDestroy", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsCursorHidden", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "ShowCursor" + }, + "parameters": [ + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPreEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The crosshair follows the cursor before the events of the scene, so that they use its position of this frame." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Crosshair::Crosshair::FollowCursorPosition" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "", + "functionType": "Action", + "name": "doStepPostEvents", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "Crosshair::Crosshair::Update" + }, + "parameters": [ + "Object", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [] + }, + { + "fullName": "Follow the cursor", + "functionType": "Action", + "name": "FollowCursorPosition", + "sentence": "Move _PARAM0_ to the cursor", + "events": [ + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "In the events of the crosshair, the cursor position is relative to the crosshair (its origin is its center)." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "FollowCursor", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Object", + "=", + "Object.X() + CursorX(\"\", 0) * Object.Scale::X()", + "=", + "Object.Y() + CursorY(\"\", 0) * Object.Scale::Y()" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [], + "description": "Move the crosshair to the cursor.", + "private": true + }, + { + "fullName": "Update", + "functionType": "Action", + "name": "Update", + "sentence": "Update _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Spread", + "=", + "max(0, Spread - SpreadRecovery * TimeDelta())" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "MettreXY" + }, + "parameters": [ + "Arm", + "=", + "Arm.Variable(BaseX) + Arm.Variable(DirectionX) * Spread", + "=", + "Arm.Variable(BaseY) + Arm.Variable(DirectionY) * Spread" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The ring grows with the spread (its origin is its center)." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "RingBaseWidth", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "ResizableCapability::ResizableBehavior::SetSize" + }, + "parameters": [ + "Ring", + "Resizable", + "RingBaseWidth + 2 * Spread", + "RingBaseHeight + 2 * Spread" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The hit marker fades out." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "HitMarkerTime", + ">", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HitMarkerTime", + "-", + "TimeDelta()" + ] + }, + { + "type": { + "value": "Show" + }, + "parameters": [ + "HitMarker" + ] + }, + { + "type": { + "value": "Opacity" + }, + "parameters": [ + "HitMarker", + "=", + "clamp(255 * HitMarkerTime / max(0.0001, HitMarkerDuration), 0, 255)" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "NumberVariable" + }, + "parameters": [ + "HitMarkerTime", + "<=", + "0" + ] + } + ], + "actions": [ + { + "type": { + "value": "Hide" + }, + "parameters": [ + "HitMarker" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Comment", + "color": { + "b": 109, + "g": 230, + "r": 255, + "textB": 0, + "textG": 0, + "textR": 0 + }, + "comment": "The images are white: they are tinted with the color (or the color on a target)." + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "WantedColor", + "=", + "Color" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsOnTarget", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "WantedColor", + "=", + "TargetColor" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "AppliedColor", + "!=", + "WantedColor" + ] + } + ], + "actions": [ + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Center", + "WantedColor" + ] + }, + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Arm", + "WantedColor" + ] + }, + { + "type": { + "value": "ChangeColor" + }, + "parameters": [ + "Ring", + "WantedColor" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "AppliedColor", + "=", + "WantedColor" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [], + "description": "Move the arms, fade the hit marker and tint the crosshair.", + "private": true + }, + { + "fullName": "Add spread", + "functionType": "Action", + "name": "AddSpread", + "sentence": "Add _PARAM1_ px of spread to _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Spread", + "=", + "clamp(Spread + Amount, 0, MaxSpread)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + }, + { + "description": "Spread to add (in pixels)", + "name": "Amount", + "type": "expression" + } + ], + "objectGroups": [], + "description": "Move the arms of the crosshair apart (for example when shooting). They come back by themselves.", + "group": "Spread" + }, + { + "fullName": "Spread", + "functionType": "ExpressionAndCondition", + "name": "Spread", + "sentence": "the spread", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetReturnNumber" + }, + "parameters": [ + "Spread" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [], + "description": "the spread of the crosshair (how far its arms moved apart, in pixels). It can be used to make shots less precise.", + "group": "Spread", + "expressionType": { + "type": "number" + } + }, + { + "fullName": "", + "functionType": "ActionWithOperator", + "name": "SetSpread", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "Spread", + "=", + "clamp(Value, 0, MaxSpread)" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [], + "group": "Spread", + "getterName": "Spread" + }, + { + "fullName": "Show the hit marker", + "functionType": "Action", + "name": "ShowHitMarker", + "sentence": "Show the hit marker on _PARAM0_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetNumberVariable" + }, + "parameters": [ + "HitMarkerTime", + "=", + "HitMarkerDuration" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [], + "description": "Flash a hit marker on the crosshair (for example when a shot hits an enemy).", + "group": "Hit marker" + }, + { + "fullName": "On a target", + "functionType": "Action", + "name": "SetOnTarget", + "sentence": "_PARAM0_ is on a target: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"OnTarget\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsOnTarget", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"OnTarget\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "IsOnTarget", + "False", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + }, + { + "description": "On a target?", + "name": "OnTarget", + "type": "yesorno" + } + ], + "objectGroups": [], + "description": "Show that the crosshair is on a target (or not): it takes its color on a target.", + "group": "Target" + }, + { + "fullName": "Is on a target", + "functionType": "Condition", + "name": "IsOnTarget", + "sentence": "_PARAM0_ is on a target", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BooleanVariable" + }, + "parameters": [ + "IsOnTarget", + "True", + "" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + } + ], + "objectGroups": [], + "description": "Check if the crosshair is on a target.", + "group": "Target" + }, + { + "fullName": "Color", + "functionType": "Action", + "name": "SetColor", + "sentence": "Change the color of _PARAM0_ to _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [], + "actions": [ + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "Color", + "=", + "Color" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + }, + { + "description": "Color", + "name": "Color", + "type": "color" + } + ], + "objectGroups": [], + "description": "Change the color of the crosshair.", + "group": "Appearance" + }, + { + "fullName": "Follow the mouse or touch", + "functionType": "Action", + "name": "SetFollowCursor", + "sentence": "_PARAM0_ follows the cursor: _PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldFollow\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "FollowCursor", + "True", + "" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "inverted": true, + "value": "GetArgumentAsBoolean" + }, + "parameters": [ + "\"ShouldFollow\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetBooleanVariable" + }, + "parameters": [ + "FollowCursor", + "False", + "" + ] + } + ] + } + ], + "parameters": [ + { + "description": "Object", + "name": "Object", + "supplementaryInformation": "Crosshair::Crosshair", + "type": "object" + }, + { + "description": "Follow the cursor?", + "name": "ShouldFollow", + "type": "yesorno" + } + ], + "objectGroups": [], + "description": "Make the crosshair follow the mouse cursor (or the touch), or not (to move it with events, for example to the center of the screen or with a gamepad)." + } + ] + } + ] +} \ No newline at end of file