Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "firstLayout": "",
- "gdVersion": {
- "build": 213,
- "major": 5,
- "minor": 4,
- "revision": 0
- },
- "properties": {
- "adaptGameResolutionAtRuntime": true,
- "antialiasingMode": "MSAA",
- "antialisingEnabledOnMobile": false,
- "folderProject": false,
- "orientation": "default",
- "packageName": "com.example.gamename",
- "pixelsRounding": true,
- "projectUuid": "5c0875be-73e7-4f39-92cc-2f1d88d33c61",
- "scaleMode": "nearest",
- "sizeOnStartupMode": "adaptWidth",
- "templateSlug": "",
- "useExternalSourceFiles": false,
- "version": "1.0.0",
- "name": "per_daw",
- "description": "",
- "author": "",
- "windowWidth": 1024,
- "windowHeight": 768,
- "latestCompilationDirectory": "",
- "maxFPS": 60,
- "minFPS": 20,
- "verticalSync": false,
- "platformSpecificAssets": {},
- "loadingScreen": {
- "backgroundColor": 0,
- "backgroundFadeInDuration": 0.2,
- "backgroundImageResourceName": "",
- "gdevelopLogoStyle": "light",
- "logoAndProgressFadeInDuration": 0.2,
- "logoAndProgressLogoFadeInDelay": 0,
- "minDuration": 1.5,
- "progressBarColor": 16777215,
- "progressBarHeight": 20,
- "progressBarMaxWidth": 200,
- "progressBarMinWidth": 40,
- "progressBarWidthPercent": 30,
- "showGDevelopSplash": true,
- "showProgressBar": true
- },
- "watermark": {
- "placement": "bottom-left",
- "showWatermark": true
- },
- "authorIds": [],
- "authorUsernames": [],
- "categories": [],
- "playableDevices": [],
- "extensionProperties": [],
- "platforms": [
- {
- "name": "GDevelop JS platform"
- }
- ],
- "currentPlatform": "GDevelop JS platform"
- },
- "resources": {
- "resources": [
- {
- "file": "resources/snd.wav",
- "kind": "audio",
- "metadata": "",
- "name": "resources\\snd.wav",
- "preloadAsMusic": false,
- "preloadAsSound": true,
- "preloadInCache": false,
- "userAdded": true
- }
- ],
- "resourceFolders": []
- },
- "objects": [],
- "objectsFolderStructure": {
- "folderName": "__ROOT"
- },
- "objectsGroups": [],
- "variables": [
- {
- "folded": true,
- "name": "num_a",
- "type": "number",
- "value": 0
- },
- {
- "name": "notes",
- "type": "array",
- "children": [
- {
- "folded": true,
- "type": "number",
- "value": 1
- },
- {
- "type": "number",
- "value": 1.12246
- },
- {
- "folded": true,
- "type": "number",
- "value": 1.25992
- },
- {
- "type": "number",
- "value": 1.33484
- },
- {
- "type": "number",
- "value": 1.49831
- },
- {
- "type": "number",
- "value": 1.68179
- },
- {
- "type": "number",
- "value": 1.88775
- },
- {
- "folded": true,
- "type": "number",
- "value": 2
- }
- ]
- }
- ],
- "layouts": [
- {
- "b": 17,
- "disableInputWhenNotFocused": true,
- "mangledName": "tst_95pitch",
- "name": "tst_pitch",
- "r": 17,
- "standardSortMethod": true,
- "stopSoundsOnStartup": true,
- "title": "",
- "v": 17,
- "uiSettings": {
- "grid": false,
- "gridType": "rectangular",
- "gridWidth": 32,
- "gridHeight": 32,
- "gridOffsetX": 0,
- "gridOffsetY": 0,
- "gridColor": 10401023,
- "gridAlpha": 0.8,
- "snap": false,
- "zoomFactor": 0.3645833333333333,
- "windowMask": false
- },
- "objectsGroups": [],
- "variables": [],
- "instances": [],
- "objects": [],
- "objectsFolderStructure": {
- "folderName": "__ROOT"
- },
- "events": [
- {
- "type": "BuiltinCommonInstructions::Comment",
- "color": {
- "b": 109,
- "g": 230,
- "r": 255,
- "textB": 0,
- "textG": 0,
- "textR": 0
- },
- "comment": "by perprerp\ngdv audio test\nfading audio out/in causes clipping\n\n"
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "DepartScene"
- },
- "parameters": [
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "ResetTimer"
- },
- "parameters": [
- "",
- "\"tim_a\""
- ]
- },
- {
- "type": {
- "value": "ModVarGlobal"
- },
- "parameters": [
- "num_a",
- "=",
- "0"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "CompareTimer"
- },
- "parameters": [
- "",
- "\"tim_a\"",
- ">=",
- "1.5"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "ResetTimer"
- },
- "parameters": [
- "",
- "\"tim_a\""
- ]
- },
- {
- "type": {
- "value": "PlaySoundCanal"
- },
- "parameters": [
- "",
- "resources\\snd.wav",
- "1",
- "",
- "100",
- "notes[ num_a ]"
- ]
- },
- {
- "type": {
- "value": "FadeSoundVolume"
- },
- "parameters": [
- "",
- "1",
- "0",
- "(sin( TimeFromStart() /1.47 )/2+0.5) * 1.35 + 0.1"
- ]
- },
- {
- "type": {
- "value": "ModVarGlobal"
- },
- "parameters": [
- "num_a",
- "+",
- "1"
- ]
- }
- ],
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "VarGlobal"
- },
- "parameters": [
- "num_a",
- ">=",
- "GlobalVariableChildCount( notes )"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "ModVarGlobal"
- },
- "parameters": [
- "num_a",
- "+",
- "-GlobalVariableChildCount( notes )"
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": []
- }
- ],
- "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": [
- {
- "effectType": "Scene3D::HemisphereLight",
- "name": "3D Light",
- "doubleParameters": {
- "elevation": 45,
- "intensity": 1,
- "rotation": 0
- },
- "stringParameters": {
- "groundColor": "64;64;64",
- "skyColor": "255;255;255",
- "top": "Y-"
- },
- "booleanParameters": {}
- }
- ]
- }
- ],
- "behaviorsSharedData": []
- }
- ],
- "externalEvents": [],
- "eventsFunctionsExtensions": [
- {
- "author": "",
- "category": "User interface",
- "extensionNamespace": "",
- "fullName": "Toggle switch",
- "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.3.1",
- "description": [
- "Toggle switch that users can click or touch. The switch can be customized with sprites.",
- "",
- "There are ready-to-use toggle switches in the asset-store [settings UI pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=settings-ui-settings-ui)."
- ],
- "origin": {
- "identifier": "SpriteToggleSwitch",
- "name": "gdevelop-extension-store"
- },
- "tags": [
- "ui",
- "widget",
- "toggle",
- "switch",
- "check box"
- ],
- "authorIds": [
- "IWykYNRvhCZBN3vEgKEbBPOR3Oc2",
- "gqDaZjCfevOOxBYkK6zlhtZnXCg1"
- ],
- "dependencies": [],
- "globalVariables": [],
- "sceneVariables": [],
- "eventsFunctions": [],
- "eventsBasedBehaviors": [
- {
- "description": "The finite state machine used internally by the switch object.",
- "fullName": "Switch finite state machine",
- "name": "SwitchFSM",
- "objectType": "",
- "private": true,
- "eventsFunctions": [
- {
- "fullName": "",
- "functionType": "Action",
- "name": "doStepPreEvents",
- "sentence": "",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetPropertyWasChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- "no"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::IsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetPropertyWasChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- "yes"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::IsClicked"
- },
- "parameters": [
- "Object",
- "ButtonFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::TogglePropertyIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::SwitchFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch is checked.",
- "fullName": "Is checked",
- "functionType": "Condition",
- "name": "IsChecked",
- "sentence": "_PARAM0_ is checked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::PropertyIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::SwitchFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch was checked in the current frame.",
- "fullName": "Has just been checked",
- "functionType": "Condition",
- "name": "HasJustBeenChecked",
- "sentence": "_PARAM0_ has just been checked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::PropertyIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- },
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SwitchFSM::PropertyWasChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::SwitchFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch was unchecked in the current frame.",
- "fullName": "Has just been unchecked",
- "functionType": "Condition",
- "name": "HasJustBeenUnchecked",
- "sentence": "_PARAM0_ has just been unchecked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SwitchFSM::PropertyIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::PropertyWasChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::SwitchFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch was toggled in the current frame.",
- "fullName": "Has just been toggled",
- "functionType": "Condition",
- "name": "HasJustBeenToggled",
- "sentence": "_PARAM0_ has just been toggled",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::HasJustBeenChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::HasJustBeenUnchecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::SwitchFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check (or uncheck) the toggle switch.",
- "fullName": "Check (or uncheck)",
- "functionType": "Action",
- "name": "SetChecked",
- "sentence": "Check _PARAM0_: _PARAM2_",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Comment",
- "color": {
- "b": 109,
- "g": 230,
- "r": 255,
- "textB": 0,
- "textG": 0,
- "textR": 0
- },
- "comment": "Avoid a started touch to interfere with a state change from events."
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "BuiltinCommonInstructions::Or"
- },
- "parameters": [],
- "subInstructions": [
- {
- "type": {
- "value": "BuiltinCommonInstructions::And"
- },
- "parameters": [],
- "subInstructions": [
- {
- "type": {
- "inverted": true,
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"Value\""
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::IsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ]
- },
- {
- "type": {
- "value": "BuiltinCommonInstructions::And"
- },
- "parameters": [],
- "subInstructions": [
- {
- "type": {
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"Value\""
- ]
- },
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SwitchFSM::IsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ]
- }
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::ResetState"
- },
- "parameters": [
- "Object",
- "ButtonFSM",
- ""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"Value\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetPropertyIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- "no"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"Value\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetPropertyIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- "yes"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::SwitchFSM",
- "type": "behavior"
- },
- {
- "defaultValue": "yes",
- "description": "IsChecked",
- "name": "Value",
- "optional": true,
- "type": "yesorno"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Toggle the switch.",
- "fullName": "Toggle",
- "functionType": "Action",
- "name": "ToggleChecked",
- "sentence": "Toggle _PARAM0_",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetPropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::IsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetPropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- "yes"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::PropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- "no",
- ""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SwitchFSM::PropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetChecked"
- },
- "parameters": [
- "Object",
- "Behavior",
- "yes",
- ""
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::SwitchFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- }
- ],
- "propertyDescriptors": [
- {
- "value": "",
- "type": "Behavior",
- "label": "Button finite state machine",
- "description": "",
- "group": "",
- "extraInformation": [
- "SpriteToggleSwitch::ButtonFSM"
- ],
- "name": "ButtonFSM"
- },
- {
- "value": "false",
- "type": "Boolean",
- "label": "Is checked",
- "description": "",
- "group": "",
- "extraInformation": [],
- "name": "IsChecked"
- },
- {
- "value": "",
- "type": "Boolean",
- "label": "",
- "description": "",
- "group": "",
- "extraInformation": [],
- "name": "PreviousIsChecked"
- },
- {
- "value": "",
- "type": "Boolean",
- "label": "",
- "description": "",
- "group": "",
- "extraInformation": [],
- "hidden": true,
- "name": "WasChecked"
- }
- ],
- "sharedPropertyDescriptors": []
- },
- {
- "description": "The finite state machine used internally by the button object.",
- "fullName": "Button finite state machine",
- "name": "ButtonFSM",
- "objectType": "",
- "private": true,
- "eventsFunctions": [
- {
- "fullName": "",
- "functionType": "Action",
- "name": "doStepPostEvents",
- "sentence": "",
- "events": [
- {
- "colorB": 228,
- "colorG": 176,
- "colorR": 74,
- "creationTime": 0,
- "name": "Finite state machine",
- "source": "",
- "type": "BuiltinCommonInstructions::Group",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Comment",
- "color": {
- "b": 109,
- "g": 230,
- "r": 255,
- "textB": 0,
- "textG": 0,
- "textR": 0
- },
- "comment": "The \"Validated\" state only last one frame."
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Validated\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Idle\""
- ]
- }
- ]
- },
- {
- "colorB": 228,
- "colorG": 176,
- "colorR": 74,
- "creationTime": 0,
- "name": "Check position",
- "source": "",
- "type": "BuiltinCommonInstructions::Group",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Comment",
- "color": {
- "b": 109,
- "g": 230,
- "r": 255,
- "textB": 0,
- "textG": 0,
- "textR": 0
- },
- "comment": "Make sure the cursor position is only checked once per frame."
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyMouseIsInside"
- },
- "parameters": [
- "Object",
- "Behavior",
- "no"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyShouldCheckHovering"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- },
- {
- "type": {
- "value": "CollisionPoint"
- },
- "parameters": [
- "Object",
- "MouseOnlyCursorX(Object.Layer(), 0)",
- "MouseOnlyCursorY(Object.Layer(), 0)"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyMouseIsInside"
- },
- "parameters": [
- "Object",
- "Behavior",
- "yes"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Comment",
- "color": {
- "b": 109,
- "g": 230,
- "r": 255,
- "textB": 0,
- "textG": 0,
- "textR": 0
- },
- "comment": "Touches are always pressed, so ShouldCheckHovering doesn't matter."
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyTouchIsInside"
- },
- "parameters": [
- "Object",
- "Behavior",
- "no"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchId"
- },
- "parameters": [
- "Object",
- "Behavior",
- "!=",
- "0"
- ]
- },
- {
- "type": {
- "value": "CollisionPoint"
- },
- "parameters": [
- "Object",
- "TouchX(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)",
- "TouchY(Object.Behavior::PropertyTouchId(), Object.Layer(), 0)"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyTouchIsInside"
- },
- "parameters": [
- "Object",
- "Behavior",
- "yes"
- ]
- }
- ]
- }
- ],
- "parameters": []
- },
- {
- "colorB": 228,
- "colorG": 176,
- "colorR": 74,
- "creationTime": 0,
- "name": "Handle touch start",
- "source": "",
- "type": "BuiltinCommonInstructions::Group",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "HasAnyTouchOrMouseStarted"
- },
- "parameters": [
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyIndex"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "0"
- ]
- }
- ],
- "events": [
- {
- "type": "BuiltinCommonInstructions::Repeat",
- "repeatExpression": "StartedTouchOrMouseCount()",
- "conditions": [],
- "actions": [],
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "CollisionPoint"
- },
- "parameters": [
- "Object",
- "TouchX(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)",
- "TouchY(StartedTouchOrMouseId(Object.Behavior::PropertyIndex()), Object.Layer(), 0)"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyTouchId"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "StartedTouchOrMouseId(Object.Behavior::PropertyIndex())"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyTouchIsInside"
- },
- "parameters": [
- "Object",
- "Behavior",
- "yes"
- ]
- }
- ],
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "BuiltinCommonInstructions::Or"
- },
- "parameters": [],
- "subInstructions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Hovered\""
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Idle\""
- ]
- }
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedInside\""
- ]
- }
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyIndex"
- },
- "parameters": [
- "Object",
- "Behavior",
- "+",
- "1"
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ],
- "parameters": []
- },
- {
- "colorB": 228,
- "colorG": 176,
- "colorR": 74,
- "creationTime": 0,
- "name": "Apply position changes",
- "source": "",
- "type": "BuiltinCommonInstructions::Group",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyMouseIsInside"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Hovered\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Idle\""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyMouseIsInside"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Idle\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Hovered\""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedInside\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedOutside\""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside"
- },
- "parameters": [
- "Object",
- "Behavior"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedOutside\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedInside\""
- ]
- }
- ]
- }
- ],
- "parameters": []
- },
- {
- "colorB": 228,
- "colorG": 176,
- "colorR": 74,
- "creationTime": 0,
- "name": "Handle touch end",
- "source": "",
- "type": "BuiltinCommonInstructions::Group",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "HasTouchEnded"
- },
- "parameters": [
- "",
- "Object.Behavior::PropertyTouchId()"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyTouchId"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "0"
- ]
- }
- ],
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedInside\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Validated\""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedInside\""
- ]
- },
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Validated\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Idle\""
- ]
- }
- ]
- }
- ]
- }
- ],
- "parameters": []
- }
- ],
- "parameters": []
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "fullName": "",
- "functionType": "Action",
- "name": "onDeActivate",
- "sentence": "",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::ResetState"
- },
- "parameters": [
- "Object",
- "Behavior",
- ""
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Reset the state of the button.",
- "fullName": "Reset state",
- "functionType": "Action",
- "name": "ResetState",
- "sentence": "Reset the button state of _PARAM0_",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Idle\""
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::SetPropertyTouchId"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "0"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button is not used.",
- "fullName": "Is idle",
- "functionType": "Condition",
- "name": "IsIdle",
- "sentence": "_PARAM0_ is idle",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Idle\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button was just clicked.",
- "fullName": "Is clicked",
- "functionType": "Condition",
- "name": "IsClicked",
- "sentence": "_PARAM0_ is clicked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Validated\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the cursor is hovered over the button.",
- "fullName": "Is hovered",
- "functionType": "Condition",
- "name": "IsHovered",
- "sentence": "_PARAM0_ is hovered",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Hovered\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button is either hovered or pressed but not hovered.",
- "fullName": "Is focused",
- "functionType": "Condition",
- "name": "IsFocused",
- "sentence": "_PARAM0_ is focused",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"Hovered\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedOutside\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button is currently being pressed with mouse or touch.",
- "fullName": "Is pressed",
- "functionType": "Condition",
- "name": "IsPressed",
- "sentence": "_PARAM0_ is pressed",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedInside\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button is currently being pressed outside with mouse or touch.",
- "fullName": "Is held outside",
- "functionType": "Condition",
- "name": "IsPressedOutside",
- "sentence": "_PARAM0_ is held outside",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
- },
- "parameters": [
- "Object",
- "Behavior",
- "=",
- "\"PressedOutside\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "the touch id that is using the button or 0 if none.",
- "fullName": "Touch id",
- "functionType": "ExpressionAndCondition",
- "name": "TouchId",
- "sentence": "the touch id",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SetReturnNumber"
- },
- "parameters": [
- "Object.Behavior::PropertyTouchId()"
- ]
- }
- ]
- }
- ],
- "expressionType": {
- "type": "expression"
- },
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "type": "object"
- },
- {
- "description": "Behavior",
- "name": "Behavior",
- "supplementaryInformation": "SpriteToggleSwitch::ButtonFSM",
- "type": "behavior"
- }
- ],
- "objectGroups": []
- }
- ],
- "propertyDescriptors": [
- {
- "value": "true",
- "type": "Boolean",
- "label": "",
- "description": "Should check hovering",
- "group": "",
- "extraInformation": [],
- "hidden": true,
- "name": "ShouldCheckHovering"
- },
- {
- "value": "Idle",
- "type": "Choice",
- "label": "State",
- "description": "",
- "group": "",
- "extraInformation": [
- "Idle",
- "Hovered",
- "PressedInside",
- "PressedOutside",
- "Validated"
- ],
- "hidden": true,
- "name": "State"
- },
- {
- "value": "0",
- "type": "Number",
- "label": "Touch id",
- "description": "",
- "group": "",
- "extraInformation": [],
- "hidden": true,
- "name": "TouchId"
- },
- {
- "value": "",
- "type": "Boolean",
- "label": "Touch is inside",
- "description": "",
- "group": "",
- "extraInformation": [],
- "hidden": true,
- "name": "TouchIsInside"
- },
- {
- "value": "",
- "type": "Boolean",
- "label": "Mouse is inside",
- "description": "",
- "group": "",
- "extraInformation": [],
- "hidden": true,
- "name": "MouseIsInside"
- },
- {
- "value": "",
- "type": "Number",
- "label": "",
- "description": "",
- "group": "",
- "extraInformation": [],
- "hidden": true,
- "name": "Index"
- }
- ],
- "sharedPropertyDescriptors": []
- }
- ],
- "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": true,
- "name": "SpriteToggleSwitch",
- "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": "Create one background instance for of each state."
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "Create"
- },
- "parameters": [
- "",
- "State",
- "0",
- "0",
- ""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Comment",
- "color": {
- "b": 109,
- "g": 230,
- "r": 255,
- "textB": 0,
- "textG": 0,
- "textR": 0
- },
- "comment": "Pass the configuration to the behavior.\nThe PreviousIsChecked property allows to detect a change of \"intial value\" on hot reload."
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::PropertyIsChecked"
- },
- "parameters": [
- "Object"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetChecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- "",
- ""
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetPropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "yes"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::PropertyIsChecked"
- },
- "parameters": [
- "Object"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetChecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- "no",
- ""
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetPropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- ""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::UpdateStateAnimation"
- },
- "parameters": [
- "Object",
- ""
- ]
- },
- {
- "type": {
- "value": "ChangeSprite"
- },
- "parameters": [
- "State",
- "=",
- "State.AnimationFrameCount() - 1"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": [
- {
- "name": "Background",
- "objects": [
- {
- "name": "Idle"
- },
- {
- "name": "Hovered"
- },
- {
- "name": "Pressed"
- }
- ]
- }
- ]
- },
- {
- "fullName": "",
- "functionType": "Action",
- "name": "onHotReloading",
- "sentence": "",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::PropertyIsChecked"
- },
- "parameters": [
- "Object"
- ]
- },
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::PropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "SwitchFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked"
- },
- "parameters": [
- "Object",
- "yes",
- "no"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetPropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "yes"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::PropertyIsChecked"
- },
- "parameters": [
- "Object"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::PropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "SwitchFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetChecked"
- },
- "parameters": [
- "Object",
- "SwitchFSM",
- "no"
- ]
- },
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::SetPropertyPreviousIsChecked"
- },
- "parameters": [
- "Object",
- "no"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "fullName": "",
- "functionType": "Action",
- "name": "doStepPostEvents",
- "sentence": "",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::UpdateStateAnimation"
- },
- "parameters": [
- "Object",
- ""
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch is checked.",
- "fullName": "Is checked",
- "functionType": "Condition",
- "name": "IsChecked",
- "sentence": "_PARAM0_ is checked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::IsChecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch was checked in the current frame.",
- "fullName": "Has just been checked",
- "functionType": "Condition",
- "name": "HasJustBeenChecked",
- "sentence": "_PARAM0_ has just been checked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::HasJustBeenChecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch was unchecked in the current frame.",
- "fullName": "Has just been unchecked",
- "functionType": "Condition",
- "name": "HasJustBeenUnchecked",
- "sentence": "_PARAM0_ has just been unchecked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::HasJustBeenUnchecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the toggle switch was checked or unchecked in the current frame.",
- "fullName": "Has just been toggled",
- "functionType": "Condition",
- "name": "HasJustBeenToggled",
- "sentence": "_PARAM0_ has just been toggled",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::HasJustBeenToggled"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check (or uncheck) the toggle switch.",
- "fullName": "Check (or uncheck)",
- "functionType": "Action",
- "name": "SetChecked",
- "sentence": "Check _PARAM0_: _PARAM1_",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"Value\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetChecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- "no",
- ""
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"Value\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::SetChecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- "yes",
- ""
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- },
- {
- "defaultValue": "yes",
- "description": "IsChecked",
- "name": "Value",
- "optional": true,
- "type": "yesorno"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Toggle the switch.",
- "fullName": "Toggle",
- "functionType": "Action",
- "name": "ToggleChecked",
- "sentence": "Toggle _PARAM0_",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [],
- "actions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SwitchFSM::ToggleChecked"
- },
- "parameters": [
- "State",
- "SwitchFSM",
- ""
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button is not used.",
- "fullName": "Is idle",
- "functionType": "Condition",
- "name": "IsIdle",
- "private": true,
- "sentence": "_PARAM0_ is idle",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::IsIdle"
- },
- "parameters": [
- "State",
- "ButtonFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button was just clicked.",
- "fullName": "Is clicked",
- "functionType": "Condition",
- "name": "IsClicked",
- "private": true,
- "sentence": "_PARAM0_ is clicked",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::IsClicked"
- },
- "parameters": [
- "State",
- "ButtonFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the cursor is hovered over the button.",
- "fullName": "Is hovered",
- "functionType": "Condition",
- "name": "IsHovered",
- "sentence": "_PARAM0_ is hovered",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::IsHovered"
- },
- "parameters": [
- "State",
- "ButtonFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button is either hovered or pressed but not hovered.",
- "fullName": "Is focused",
- "functionType": "Condition",
- "name": "IsFocused",
- "private": true,
- "sentence": "_PARAM0_ is focused",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::IsFocused"
- },
- "parameters": [
- "State",
- "ButtonFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Check if the button is currently being pressed with mouse or touch.",
- "fullName": "Is pressed",
- "functionType": "Condition",
- "name": "IsPressed",
- "private": true,
- "sentence": "_PARAM0_ is pressed",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::ButtonFSM::IsPressed"
- },
- "parameters": [
- "State",
- "ButtonFSM",
- ""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "description": "Update the state animation.",
- "fullName": "Update state animation",
- "functionType": "Action",
- "name": "UpdateStateAnimation",
- "private": true,
- "sentence": "Update the state animation of _PARAM0_",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked"
- },
- "parameters": [
- "Object",
- "ButtonFSM",
- ""
- ]
- },
- {
- "type": {
- "value": "AnimationName"
- },
- "parameters": [
- "State",
- "\"Unchecked\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetAnimationName"
- },
- "parameters": [
- "State",
- "\"Checked\""
- ]
- },
- {
- "type": {
- "value": "PlayAnimation"
- },
- "parameters": [
- "State"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "SpriteToggleSwitch::SpriteToggleSwitch::IsChecked"
- },
- "parameters": [
- "Object",
- "ButtonFSM",
- ""
- ]
- },
- {
- "type": {
- "value": "AnimationName"
- },
- "parameters": [
- "State",
- "\"Checked\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetAnimationName"
- },
- "parameters": [
- "State",
- "\"Unchecked\""
- ]
- },
- {
- "type": {
- "value": "PlayAnimation"
- },
- "parameters": [
- "State"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- },
- {
- "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": [
- {
- "type": {
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"ShouldActivate\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "ActivateBehavior"
- },
- "parameters": [
- "State",
- "ButtonFSM",
- "yes"
- ]
- }
- ]
- },
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "inverted": true,
- "value": "GetArgumentAsBoolean"
- },
- "parameters": [
- "\"ShouldActivate\""
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "ActivateBehavior"
- },
- "parameters": [
- "State",
- "ButtonFSM",
- "no"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "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",
- "events": [
- {
- "type": "BuiltinCommonInstructions::Standard",
- "conditions": [
- {
- "type": {
- "value": "BehaviorActivated"
- },
- "parameters": [
- "State",
- "ButtonFSM"
- ]
- }
- ],
- "actions": [
- {
- "type": {
- "value": "SetReturnBoolean"
- },
- "parameters": [
- "True"
- ]
- }
- ]
- }
- ],
- "parameters": [
- {
- "description": "Object",
- "name": "Object",
- "supplementaryInformation": "SpriteToggleSwitch::SpriteToggleSwitch",
- "type": "object"
- }
- ],
- "objectGroups": []
- }
- ],
- "propertyDescriptors": [
- {
- "value": "true",
- "type": "Boolean",
- "label": "Is checked",
- "description": "",
- "group": "",
- "extraInformation": [],
- "name": "IsChecked"
- },
- {
- "value": "",
- "type": "Boolean",
- "label": "",
- "description": "It's used to detect a change at hot reload.",
- "group": "",
- "extraInformation": [],
- "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"
- }
- ]
- },
- "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": []
- }
- ]
- }
- ],
- "externalLayouts": [],
- "externalSourceFiles": []
- }
Add Comment
Please, Sign In to add comment