Skip to content
Closed
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
270 changes: 270 additions & 0 deletions extensions/community/MultitouchForJoystickCustom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
{
"author": "",
"category": "Movement",
"dimension": "2D",
"extensionNamespace": "",
"fullName": "JoyChan",
"gdevelopVersion": "",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPGc+DQoJPHBhdGggZD0iTTExLDExVjIuOUM3LjMsNC40LDQuNCw3LjMsMi45LDExSDExeiIvPg0KCTxwYXRoIGQ9Ik0yMSwxMWg4LjFjLTEuNC0zLjctNC40LTYuNi04LjE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csOCwxNi43LDhoLTEuM2MtMC40LDAtMC43LTAuMi0wLjktMC41DQoJCUMxNC4zLDcuMSwxNC4zLDYuOCwxNC41LDYuNHogTTE3LjUsMjUuNmwtMC43LDFDMTYuNiwyNi44LDE2LjMsMjcsMTYsMjdzLTAuNi0wLjItMC44LTAuNGwtMC43LTFjLTAuMi0wLjMtMC4yLTAuNywwLTENCgkJYzAuMi0wLjMsMC41LTAuNSwwLjktMC41aDEuM2MwLjQsMCwwLjcsMC4yLDAuOSwwLjVDMTcuNywyNC45LDE3LjcsMjUuMiwxNy41LDI1LjZ6Ii8+DQo8L2c+DQo8L3N2Zz4NCg==",
"name": "MultitouchForJoystickCustom",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Videogames/b91cb8a9c1b7a99ee402b29982551afd10c3cf959d82de174c44adff7cc57ffb_Videogames_controller_joystick_arrows_direction.svg",
"shortDescription": "Joystick-chan only cares about one of your fingers.",
"version": "0.0.1",
"description": "This extension includes a behavior for the Thumb called Joystick, and an action with basic options called \"Are you having Joy?\".",
"tags": [
"Joystick",
"Multi",
"Multitouch"
],
"authorIds": [
"FKjuaL0PE2WDrq94jY5kanJhLzM2"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT"
},
"eventsBasedBehaviors": [
{
"description": "Simply add it to the Thumb (do not adjust its properties automatically), and make sure the Thumb, Border, and StickZone are all on the same layer, separate from the layer where the Camera is configured.",
"fullName": "JoyStick",
"helpPath": "",
"iconUrl": "",
"name": "Joystick",
"objectType": "Sprite",
"previewIconUrl": "",
"eventsFunctions": [
{
"description": "Select the Thumb, Border, and Zone, then set the Radius for your joystick.",
"fullName": "Are you having Joy?",
"functionType": "Action",
"name": "Function",
"sentence": "Thumb: _PARAM0_ Zone: _PARAM2_ Border: _PARAM3_ Set MaxRad: _PARAM4_ Layer: _PARAM5_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"Active",
"True",
""
]
},
{
"type": {
"value": "HasAnyTouchOrMouseStarted"
},
"parameters": [
""
]
},
{
"type": {
"value": "IsCursorOnObject"
},
"parameters": [
"Zone",
"",
"",
""
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"Active",
"False",
""
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TouchID",
"=",
"StartedTouchOrMouseId(0)"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"Active",
"False",
""
]
}
],
"actions": [
{
"type": {
"value": "SetX"
},
"parameters": [
"Object",
"=",
"Border.X() + min(MaxRad, DistanceBetweenPositions(Border.X(), Border.Y(), TouchX(TouchID, Layer), TouchY(TouchID, Layer))) * cos(ToRad(AngleBetweenPositions(Border.X(), Border.Y(), TouchX(TouchID, Layer), TouchY(TouchID, Layer))))\n"
]
},
{
"type": {
"value": "SetY"
},
"parameters": [
"Object",
"=",
"Border.Y() + min(MaxRad, DistanceBetweenPositions(Border.X(), Border.Y(), TouchX(TouchID, Layer), TouchY(TouchID, Layer))) * sin(ToRad(AngleBetweenPositions(Border.X(), Border.Y(), TouchX(TouchID, Layer), TouchY(TouchID, Layer))))\n"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"Active",
"False",
""
]
},
{
"type": {
"value": "HasTouchEnded"
},
"parameters": [
"",
"TouchID"
]
}
],
"actions": [
{
"type": {
"value": "SetX"
},
"parameters": [
"Object",
"=",
"Border.X()"
]
},
{
"type": {
"value": "SetY"
},
"parameters": [
"Object",
"=",
"Border.Y()"
]
},
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"Active",
"True",
""
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "Sprite",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "MultitouchForJoystickCustom::Joystick",
"type": "behavior"
},
{
"description": "Select the touch zone of the joystick",
"name": "Zone",
"type": "objectList"
},
{
"description": "Select the border object of the joystick",
"name": "Border",
"type": "objectList"
},
{
"description": "Set the maximum radius of the joystick",
"name": "MaxRad",
"type": "expression"
},
{
"description": "Select the Object layer",
"name": "Layer",
"type": "layer"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "Function"
}
]
},
"propertyDescriptors": [
{
"value": "-1",
"type": "Number",
"label": "",
"name": "TouchID"
},
{
"value": "true",
"type": "Boolean",
"label": "",
"name": "Active"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "TouchID"
},
{
"propertyName": "Active"
}
]
}
}
],
"eventsBasedObjects": []
}