Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
316 changes: 150 additions & 166 deletions extensions/community/SpriteToggleSwitch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"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.1.0",
"version": "1.1.1",
"description": "Toggle switch that users can click or touch. The switch can be customized with sprites.",
"tags": [
"ui",
Expand All @@ -21,29 +21,7 @@
"gqDaZjCfevOOxBYkK6zlhtZnXCg1"
],
"dependencies": [],
"eventsFunctions": [
{
"fullName": "Any touch pressed",
"functionType": "Condition",
"name": "AnyTouchPressed",
"private": true,
"sentence": "Any touch is pressed",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"eventsFunctionContext.returnValue = runtimeScene.getGame().getInputManager()._touches.firstKey() !== null;",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [],
"objectGroups": []
}
],
"eventsFunctions": [],
"eventsBasedBehaviors": [
{
"description": "The finite state machine used internally by the switch object.",
Expand Down Expand Up @@ -735,73 +713,64 @@
},
{
"type": {
"inverted": true,
"value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside"
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior"
"Behavior",
"=",
"\"Hovered\""
]
}
],
"actions": [],
"events": [
"actions": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Hovered\""
]
}
],
"actions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyMouseIsInside"
},
"parameters": [
"Object",
"Behavior"
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
],
"actions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
],
"actions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Hovered\""
]
}
]
Expand All @@ -811,99 +780,74 @@
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
"inverted": true,
"value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyMouseIsInside"
},
"parameters": [
"Object",
"Behavior"
]
},
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside"
},
"parameters": [
"Object",
"Behavior"
]
}
"parameters": [
"Object",
"Behavior"
]
},
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
],
"actions": [],
"events": [
"actions": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
],
"actions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyTouchIsInside"
},
"parameters": [
"Object",
"Behavior"
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "MouseButtonPressed"
},
"parameters": [
"",
"Left"
]
},
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
],
"actions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Hovered\""
]
}
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedOutside\""
]
}
],
"actions": [
{
"type": {
"value": "SpriteToggleSwitch::ButtonFSM::SetPropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"PressedInside\""
]
}
]
Expand Down Expand Up @@ -1361,6 +1305,46 @@
}
],
"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": [
Expand Down
Loading