Skip to content

Commit d26d0a6

Browse files
committed
[Toggle] Use property mapping.
1 parent 7dd3107 commit d26d0a6

File tree

1 file changed

+122
-94
lines changed

1 file changed

+122
-94
lines changed

extensions/reviewed/SpriteToggleSwitch.json

Lines changed: 122 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"author": "",
33
"category": "User interface",
44
"extensionNamespace": "",
5-
"gdevelopVersion": ">=5.5.222",
65
"fullName": "Toggle switch",
6+
"gdevelopVersion": ">=5.5.222",
77
"helpPath": "/objects/toggle-switch",
88
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIzLDIzSDljLTMuOSwwLTctMy4xLTctN3YwYzAtMy45LDMuMS03LDctN2gxNGMzLjksMCw3LDMuMSw3LDd2MEMzMCwxOS45LDI2LjksMjMsMjMsMjN6Ii8+DQo8Y2lyY2xlIGNsYXNzPSJzdDAiIGN4PSI5IiBjeT0iMTYiIHI9IjQiLz4NCjwvc3ZnPg0K",
99
"name": "SpriteToggleSwitch",
1010
"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",
1111
"shortDescription": "Toggle switch that users can click or touch.",
12-
"version": "1.4.0",
12+
"version": "1.5.0",
1313
"description": [
1414
"Toggle switch that users can click or touch. The switch can be customized with sprites.",
1515
"",
@@ -31,6 +31,8 @@
3131
"gqDaZjCfevOOxBYkK6zlhtZnXCg1"
3232
],
3333
"dependencies": [],
34+
"globalVariables": [],
35+
"sceneVariables": [],
3436
"eventsFunctions": [],
3537
"eventsBasedBehaviors": [
3638
{
@@ -1867,47 +1869,135 @@
18671869
],
18681870
"eventsBasedObjects": [
18691871
{
1872+
"areaMaxX": 64,
1873+
"areaMaxY": 64,
1874+
"areaMaxZ": 64,
1875+
"areaMinX": 0,
1876+
"areaMinY": 0,
1877+
"areaMinZ": 0,
18701878
"defaultName": "ToggleSwitch",
18711879
"description": "A toggle switch that users can click or touch.",
18721880
"fullName": "Toggle switch",
1881+
"isUsingLegacyInstancesRenderer": false,
18731882
"name": "SpriteToggleSwitch",
1874-
"eventsFunctions": [
1883+
"objects": [
18751884
{
1876-
"fullName": "",
1877-
"functionType": "Action",
1878-
"name": "onCreated",
1879-
"sentence": "",
1880-
"events": [
1885+
"adaptCollisionMaskAutomatically": true,
1886+
"assetStoreId": "",
1887+
"name": "State",
1888+
"type": "Sprite",
1889+
"updateIfNotVisible": false,
1890+
"variables": [],
1891+
"effects": [],
1892+
"behaviors": [
18811893
{
1882-
"type": "BuiltinCommonInstructions::Comment",
1883-
"color": {
1884-
"b": 109,
1885-
"g": 230,
1886-
"r": 255,
1887-
"textB": 0,
1888-
"textG": 0,
1889-
"textR": 0
1890-
},
1891-
"comment": "Create one background instance for of each state."
1894+
"name": "ButtonFSM",
1895+
"type": "SpriteToggleSwitch::ButtonFSM",
1896+
"ShouldCheckHovering": true,
1897+
"State": "Idle",
1898+
"TouchId": 0,
1899+
"TouchIsInside": false,
1900+
"MouseIsInside": false,
1901+
"Index": 0
18921902
},
18931903
{
1894-
"type": "BuiltinCommonInstructions::Standard",
1895-
"conditions": [],
1896-
"actions": [
1904+
"name": "SwitchFSM",
1905+
"type": "SpriteToggleSwitch::SwitchFSM",
1906+
"ButtonFSM": "ButtonFSM",
1907+
"IsChecked": false,
1908+
"WasChecked": false
1909+
}
1910+
],
1911+
"animations": [
1912+
{
1913+
"name": "Unchecked",
1914+
"useMultipleDirections": false,
1915+
"directions": [
18971916
{
1898-
"type": {
1899-
"value": "Create"
1900-
},
1901-
"parameters": [
1902-
"",
1903-
"State",
1904-
"0",
1905-
"0",
1906-
""
1907-
]
1917+
"looping": false,
1918+
"timeBetweenFrames": 0.08,
1919+
"sprites": []
19081920
}
19091921
]
19101922
},
1923+
{
1924+
"name": "Checked",
1925+
"useMultipleDirections": false,
1926+
"directions": [
1927+
{
1928+
"looping": false,
1929+
"timeBetweenFrames": 0.08,
1930+
"sprites": []
1931+
}
1932+
]
1933+
}
1934+
]
1935+
}
1936+
],
1937+
"objectsFolderStructure": {
1938+
"folderName": "__ROOT",
1939+
"children": [
1940+
{
1941+
"objectName": "State"
1942+
}
1943+
]
1944+
},
1945+
"objectsGroups": [],
1946+
"layers": [
1947+
{
1948+
"ambientLightColorB": 200,
1949+
"ambientLightColorG": 200,
1950+
"ambientLightColorR": 200,
1951+
"camera3DFarPlaneDistance": 10000,
1952+
"camera3DFieldOfView": 45,
1953+
"camera3DNearPlaneDistance": 3,
1954+
"cameraType": "",
1955+
"followBaseLayerCamera": false,
1956+
"isLightingLayer": false,
1957+
"isLocked": false,
1958+
"name": "",
1959+
"renderingType": "",
1960+
"visibility": true,
1961+
"cameras": [
1962+
{
1963+
"defaultSize": true,
1964+
"defaultViewport": true,
1965+
"height": 0,
1966+
"viewportBottom": 1,
1967+
"viewportLeft": 0,
1968+
"viewportRight": 1,
1969+
"viewportTop": 0,
1970+
"width": 0
1971+
}
1972+
],
1973+
"effects": []
1974+
}
1975+
],
1976+
"instances": [
1977+
{
1978+
"angle": 0,
1979+
"customSize": true,
1980+
"depth": 0,
1981+
"height": 64,
1982+
"layer": "",
1983+
"name": "State",
1984+
"persistentUuid": "bda60bb1-c312-4710-baf7-ec7a3887c076",
1985+
"width": 64,
1986+
"x": 0,
1987+
"y": 0,
1988+
"zOrder": 1,
1989+
"numberProperties": [],
1990+
"stringProperties": [],
1991+
"initialVariables": []
1992+
}
1993+
],
1994+
"eventsFunctions": [
1995+
{
1996+
"fullName": "",
1997+
"functionType": "Action",
1998+
"name": "onCreated",
1999+
"sentence": "",
2000+
"events": [
19112001
{
19122002
"type": "BuiltinCommonInstructions::Comment",
19132003
"color": {
@@ -2947,69 +3037,7 @@
29473037
"hidden": true,
29483038
"name": "PreviousIsChecked"
29493039
}
2950-
],
2951-
"objects": [
2952-
{
2953-
"adaptCollisionMaskAutomatically": true,
2954-
"assetStoreId": "",
2955-
"name": "State",
2956-
"type": "Sprite",
2957-
"updateIfNotVisible": false,
2958-
"variables": [],
2959-
"effects": [],
2960-
"behaviors": [
2961-
{
2962-
"name": "ButtonFSM",
2963-
"type": "SpriteToggleSwitch::ButtonFSM",
2964-
"ShouldCheckHovering": true,
2965-
"State": "Idle",
2966-
"TouchId": 0,
2967-
"TouchIsInside": false,
2968-
"MouseIsInside": false,
2969-
"Index": 0
2970-
},
2971-
{
2972-
"name": "SwitchFSM",
2973-
"type": "SpriteToggleSwitch::SwitchFSM",
2974-
"ButtonFSM": "ButtonFSM",
2975-
"IsChecked": false,
2976-
"WasChecked": false
2977-
}
2978-
],
2979-
"animations": [
2980-
{
2981-
"name": "Unchecked",
2982-
"useMultipleDirections": false,
2983-
"directions": [
2984-
{
2985-
"looping": false,
2986-
"timeBetweenFrames": 0.08,
2987-
"sprites": []
2988-
}
2989-
]
2990-
},
2991-
{
2992-
"name": "Checked",
2993-
"useMultipleDirections": false,
2994-
"directions": [
2995-
{
2996-
"looping": false,
2997-
"timeBetweenFrames": 0.08,
2998-
"sprites": []
2999-
}
3000-
]
3001-
}
3002-
]
3003-
}
3004-
],
3005-
"objectsFolderStructure": {
3006-
"folderName": "__ROOT",
3007-
"children": [
3008-
{
3009-
"objectName": "State"
3010-
}
3011-
]
3012-
}
3040+
]
30133041
}
30143042
]
30153043
}

0 commit comments

Comments
 (0)