|
8 | 8 | "name": "PanelSpriteSlider",
|
9 | 9 | "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/UI Essentials/1678c39a3b2bd3df4f82a8a293770db4986a6bcfd3f78e738ddfc86e39176423_UI Essentials_sliders_options.svg",
|
10 | 10 | "shortDescription": "A draggable slider that users can move to select a numerical value.",
|
11 |
| - "version": "1.2.0", |
| 11 | + "version": "1.2.1", |
12 | 12 | "description": "A draggable slider that users can move to select a numerical value. The slider can be customized with sprites.",
|
13 | 13 | "origin": {
|
14 |
| - "identifier": "ResourceBar", |
| 14 | + "identifier": "PanelSpriteSlider", |
15 | 15 | "name": "gdevelop-extension-store"
|
16 | 16 | },
|
17 | 17 | "tags": [
|
|
25 | 25 | "gqDaZjCfevOOxBYkK6zlhtZnXCg1"
|
26 | 26 | ],
|
27 | 27 | "dependencies": [],
|
28 |
| - "eventsFunctions": [ |
29 |
| - { |
30 |
| - "fullName": "Any touch pressed", |
31 |
| - "functionType": "Condition", |
32 |
| - "name": "AnyTouchPressed", |
33 |
| - "private": true, |
34 |
| - "sentence": "Any touch is pressed", |
35 |
| - "events": [ |
36 |
| - { |
37 |
| - "type": "BuiltinCommonInstructions::JsCode", |
38 |
| - "inlineCode": [ |
39 |
| - "eventsFunctionContext.returnValue = runtimeScene.getGame().getInputManager()._touches.firstKey() !== null;", |
40 |
| - "" |
41 |
| - ], |
42 |
| - "parameterObjects": "", |
43 |
| - "useStrict": true, |
44 |
| - "eventsSheetExpanded": false |
45 |
| - } |
46 |
| - ], |
47 |
| - "parameters": [], |
48 |
| - "objectGroups": [] |
49 |
| - } |
50 |
| - ], |
| 28 | + "eventsFunctions": [], |
51 | 29 | "eventsBasedBehaviors": [
|
52 | 30 | {
|
53 | 31 | "description": "Represent a value on a slider.",
|
|
890 | 868 | },
|
891 | 869 | {
|
892 | 870 | "type": {
|
893 |
| - "inverted": true, |
894 |
| - "value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside" |
| 871 | + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
895 | 872 | },
|
896 | 873 | "parameters": [
|
897 | 874 | "Object",
|
898 |
| - "Behavior" |
| 875 | + "Behavior", |
| 876 | + "=", |
| 877 | + "\"Hovered\"" |
899 | 878 | ]
|
900 | 879 | }
|
901 | 880 | ],
|
902 |
| - "actions": [], |
903 |
| - "events": [ |
| 881 | + "actions": [ |
904 | 882 | {
|
905 |
| - "type": "BuiltinCommonInstructions::Standard", |
906 |
| - "conditions": [ |
907 |
| - { |
908 |
| - "type": { |
909 |
| - "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
910 |
| - }, |
911 |
| - "parameters": [ |
912 |
| - "Object", |
913 |
| - "Behavior", |
914 |
| - "=", |
915 |
| - "\"Hovered\"" |
916 |
| - ] |
917 |
| - } |
918 |
| - ], |
919 |
| - "actions": [ |
920 |
| - { |
921 |
| - "type": { |
922 |
| - "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
923 |
| - }, |
924 |
| - "parameters": [ |
925 |
| - "Object", |
926 |
| - "Behavior", |
927 |
| - "=", |
928 |
| - "\"Idle\"" |
929 |
| - ] |
930 |
| - } |
| 883 | + "type": { |
| 884 | + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
| 885 | + }, |
| 886 | + "parameters": [ |
| 887 | + "Object", |
| 888 | + "Behavior", |
| 889 | + "=", |
| 890 | + "\"Idle\"" |
| 891 | + ] |
| 892 | + } |
| 893 | + ] |
| 894 | + }, |
| 895 | + { |
| 896 | + "type": "BuiltinCommonInstructions::Standard", |
| 897 | + "conditions": [ |
| 898 | + { |
| 899 | + "type": { |
| 900 | + "value": "PanelSpriteSlider::ButtonFSM::PropertyMouseIsInside" |
| 901 | + }, |
| 902 | + "parameters": [ |
| 903 | + "Object", |
| 904 | + "Behavior" |
931 | 905 | ]
|
932 | 906 | },
|
933 | 907 | {
|
934 |
| - "type": "BuiltinCommonInstructions::Standard", |
935 |
| - "conditions": [ |
936 |
| - { |
937 |
| - "type": { |
938 |
| - "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
939 |
| - }, |
940 |
| - "parameters": [ |
941 |
| - "Object", |
942 |
| - "Behavior", |
943 |
| - "=", |
944 |
| - "\"PressedInside\"" |
945 |
| - ] |
946 |
| - } |
947 |
| - ], |
948 |
| - "actions": [ |
949 |
| - { |
950 |
| - "type": { |
951 |
| - "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
952 |
| - }, |
953 |
| - "parameters": [ |
954 |
| - "Object", |
955 |
| - "Behavior", |
956 |
| - "=", |
957 |
| - "\"PressedOutside\"" |
958 |
| - ] |
959 |
| - } |
| 908 | + "type": { |
| 909 | + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
| 910 | + }, |
| 911 | + "parameters": [ |
| 912 | + "Object", |
| 913 | + "Behavior", |
| 914 | + "=", |
| 915 | + "\"Idle\"" |
| 916 | + ] |
| 917 | + } |
| 918 | + ], |
| 919 | + "actions": [ |
| 920 | + { |
| 921 | + "type": { |
| 922 | + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
| 923 | + }, |
| 924 | + "parameters": [ |
| 925 | + "Object", |
| 926 | + "Behavior", |
| 927 | + "=", |
| 928 | + "\"Hovered\"" |
960 | 929 | ]
|
961 | 930 | }
|
962 | 931 | ]
|
|
966 | 935 | "conditions": [
|
967 | 936 | {
|
968 | 937 | "type": {
|
969 |
| - "value": "BuiltinCommonInstructions::Or" |
| 938 | + "inverted": true, |
| 939 | + "value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside" |
970 | 940 | },
|
971 |
| - "parameters": [], |
972 |
| - "subInstructions": [ |
973 |
| - { |
974 |
| - "type": { |
975 |
| - "value": "PanelSpriteSlider::ButtonFSM::PropertyMouseIsInside" |
976 |
| - }, |
977 |
| - "parameters": [ |
978 |
| - "Object", |
979 |
| - "Behavior" |
980 |
| - ] |
981 |
| - }, |
982 |
| - { |
983 |
| - "type": { |
984 |
| - "value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside" |
985 |
| - }, |
986 |
| - "parameters": [ |
987 |
| - "Object", |
988 |
| - "Behavior" |
989 |
| - ] |
990 |
| - } |
| 941 | + "parameters": [ |
| 942 | + "Object", |
| 943 | + "Behavior" |
| 944 | + ] |
| 945 | + }, |
| 946 | + { |
| 947 | + "type": { |
| 948 | + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
| 949 | + }, |
| 950 | + "parameters": [ |
| 951 | + "Object", |
| 952 | + "Behavior", |
| 953 | + "=", |
| 954 | + "\"PressedInside\"" |
991 | 955 | ]
|
992 | 956 | }
|
993 | 957 | ],
|
994 |
| - "actions": [], |
995 |
| - "events": [ |
| 958 | + "actions": [ |
996 | 959 | {
|
997 |
| - "type": "BuiltinCommonInstructions::Standard", |
998 |
| - "conditions": [ |
999 |
| - { |
1000 |
| - "type": { |
1001 |
| - "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
1002 |
| - }, |
1003 |
| - "parameters": [ |
1004 |
| - "Object", |
1005 |
| - "Behavior", |
1006 |
| - "=", |
1007 |
| - "\"PressedOutside\"" |
1008 |
| - ] |
1009 |
| - } |
1010 |
| - ], |
1011 |
| - "actions": [ |
1012 |
| - { |
1013 |
| - "type": { |
1014 |
| - "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
1015 |
| - }, |
1016 |
| - "parameters": [ |
1017 |
| - "Object", |
1018 |
| - "Behavior", |
1019 |
| - "=", |
1020 |
| - "\"PressedInside\"" |
1021 |
| - ] |
1022 |
| - } |
| 960 | + "type": { |
| 961 | + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
| 962 | + }, |
| 963 | + "parameters": [ |
| 964 | + "Object", |
| 965 | + "Behavior", |
| 966 | + "=", |
| 967 | + "\"PressedOutside\"" |
| 968 | + ] |
| 969 | + } |
| 970 | + ] |
| 971 | + }, |
| 972 | + { |
| 973 | + "type": "BuiltinCommonInstructions::Standard", |
| 974 | + "conditions": [ |
| 975 | + { |
| 976 | + "type": { |
| 977 | + "value": "PanelSpriteSlider::ButtonFSM::PropertyTouchIsInside" |
| 978 | + }, |
| 979 | + "parameters": [ |
| 980 | + "Object", |
| 981 | + "Behavior" |
1023 | 982 | ]
|
1024 | 983 | },
|
1025 | 984 | {
|
1026 |
| - "type": "BuiltinCommonInstructions::Standard", |
1027 |
| - "conditions": [ |
1028 |
| - { |
1029 |
| - "type": { |
1030 |
| - "inverted": true, |
1031 |
| - "value": "MouseButtonPressed" |
1032 |
| - }, |
1033 |
| - "parameters": [ |
1034 |
| - "", |
1035 |
| - "Left" |
1036 |
| - ] |
1037 |
| - }, |
1038 |
| - { |
1039 |
| - "type": { |
1040 |
| - "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
1041 |
| - }, |
1042 |
| - "parameters": [ |
1043 |
| - "Object", |
1044 |
| - "Behavior", |
1045 |
| - "=", |
1046 |
| - "\"Idle\"" |
1047 |
| - ] |
1048 |
| - } |
1049 |
| - ], |
1050 |
| - "actions": [ |
1051 |
| - { |
1052 |
| - "type": { |
1053 |
| - "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
1054 |
| - }, |
1055 |
| - "parameters": [ |
1056 |
| - "Object", |
1057 |
| - "Behavior", |
1058 |
| - "=", |
1059 |
| - "\"Hovered\"" |
1060 |
| - ] |
1061 |
| - } |
| 985 | + "type": { |
| 986 | + "value": "PanelSpriteSlider::ButtonFSM::PropertyState" |
| 987 | + }, |
| 988 | + "parameters": [ |
| 989 | + "Object", |
| 990 | + "Behavior", |
| 991 | + "=", |
| 992 | + "\"PressedOutside\"" |
| 993 | + ] |
| 994 | + } |
| 995 | + ], |
| 996 | + "actions": [ |
| 997 | + { |
| 998 | + "type": { |
| 999 | + "value": "PanelSpriteSlider::ButtonFSM::SetPropertyState" |
| 1000 | + }, |
| 1001 | + "parameters": [ |
| 1002 | + "Object", |
| 1003 | + "Behavior", |
| 1004 | + "=", |
| 1005 | + "\"PressedInside\"" |
1062 | 1006 | ]
|
1063 | 1007 | }
|
1064 | 1008 | ]
|
|
1516 | 1460 | }
|
1517 | 1461 | ],
|
1518 | 1462 | "objectGroups": []
|
| 1463 | + }, |
| 1464 | + { |
| 1465 | + "description": "the touch id that is using the button or 0 if none.", |
| 1466 | + "fullName": "Touch id", |
| 1467 | + "functionType": "ExpressionAndCondition", |
| 1468 | + "name": "TouchId", |
| 1469 | + "sentence": "the touch id", |
| 1470 | + "events": [ |
| 1471 | + { |
| 1472 | + "type": "BuiltinCommonInstructions::Standard", |
| 1473 | + "conditions": [], |
| 1474 | + "actions": [ |
| 1475 | + { |
| 1476 | + "type": { |
| 1477 | + "value": "SetReturnNumber" |
| 1478 | + }, |
| 1479 | + "parameters": [ |
| 1480 | + "Object.Behavior::PropertyTouchId()" |
| 1481 | + ] |
| 1482 | + } |
| 1483 | + ] |
| 1484 | + } |
| 1485 | + ], |
| 1486 | + "expressionType": { |
| 1487 | + "type": "expression" |
| 1488 | + }, |
| 1489 | + "parameters": [ |
| 1490 | + { |
| 1491 | + "description": "Object", |
| 1492 | + "name": "Object", |
| 1493 | + "type": "object" |
| 1494 | + }, |
| 1495 | + { |
| 1496 | + "description": "Behavior", |
| 1497 | + "name": "Behavior", |
| 1498 | + "supplementaryInformation": "PanelSpriteSlider::ButtonFSM", |
| 1499 | + "type": "behavior" |
| 1500 | + } |
| 1501 | + ], |
| 1502 | + "objectGroups": [] |
1519 | 1503 | }
|
1520 | 1504 | ],
|
1521 | 1505 | "propertyDescriptors": [
|
|
1987 | 1971 | "parameters": [
|
1988 | 1972 | "Object",
|
1989 | 1973 | "=",
|
1990 |
| - "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (MouseX() - Object.FullBarLeft()) / Object.FullBarWidth()", |
| 1974 | + "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (TouchX(Background.ButtonFSM::TouchId(), Object.Layer()) - Object.FullBarLeft()) / Object.FullBarWidth()", |
1991 | 1975 | "FillBar.Slider::MinValue() + FillBar.Slider::Size() * (MouseX() - Object.FullBarLeft()) / Object.FullBarWidth()"
|
1992 | 1976 | ]
|
1993 | 1977 | }
|
|
2111 | 2095 | "conditions": [
|
2112 | 2096 | {
|
2113 | 2097 | "type": {
|
2114 |
| - "value": "SourisSurObjet" |
| 2098 | + "value": "CollisionPoint" |
2115 | 2099 | },
|
2116 | 2100 | "parameters": [
|
2117 | 2101 | "Thumb",
|
2118 |
| - "", |
2119 |
| - "no", |
2120 |
| - "" |
| 2102 | + "MouseOnlyCursorX(Object.Layer(), 0)", |
| 2103 | + "MouseOnlyCursorY(Thumb.Layer(), 0)" |
2121 | 2104 | ]
|
2122 | 2105 | }
|
2123 | 2106 | ],
|
|
0 commit comments