Files

14682 lines
829 KiB
JSON
Raw Permalink Normal View History

2026-07-28 10:47:32 -04:00
{
"firstLayout": "Login",
"gdVersion": {
"build": 274,
"major": 5,
"minor": 6,
"revision": 0
},
"initialGDVersion": "5.6.274",
"properties": {
"adaptGameResolutionAtRuntime": true,
"antialiasingMode": "MSAA",
"antialisingEnabledOnMobile": false,
"folderProject": false,
"orientation": "landscape",
"packageName": "com.example.gamename",
"pixelsRounding": true,
"projectUuid": "95fbe47f-9217-4b08-9d51-4fe99f117474",
"scaleMode": "nearest",
"sizeOnStartupMode": "adaptWidth",
"templateSlug": "",
"version": "1.0.0",
"name": "MultiplayerTest01",
"description": "",
"author": "",
"windowWidth": 1280,
"windowHeight": 720,
"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": "assets/8BitOperatorPlus8Regular_Edited.png",
"kind": "image",
"metadata": "",
"name": "assets\\8BitOperatorPlus8Regular_Edited.png",
"smoothed": false,
"userAdded": false,
"origin": {
"identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/Pixel art/15c1797cbcb41c3a753b6bbb21cfa60284cfaf81c9891c3abf78a8e0e1cacf59_8BitOperatorPlus8Regular_Edited.png",
"name": "8BitOperatorPlus8Regular_Edited.png"
}
},
{
"file": "assets/Small Blue Button_Hovered.png",
"kind": "image",
"metadata": "",
"name": "assets\\Small Blue Button_Hovered.png",
"smoothed": false,
"userAdded": false,
"origin": {
"identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/Pixel art/f80ae062891a0a4612c0160ed931165461392019f89a8545f28c195f645ebc48_Small Blue Button_Hovered.png",
"name": "Small Blue Button_Hovered.png"
}
},
{
"file": "assets/Small Blue Button_Idle.png",
"kind": "image",
"metadata": "",
"name": "assets\\Small Blue Button_Idle.png",
"smoothed": false,
"userAdded": false,
"origin": {
"identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/Pixel art/c22b15c77047f1545806141e1129900bdc985d191b7ab5ebaae834a90c270ed2_Small Blue Button_Idle.png",
"name": "Small Blue Button_Idle.png"
}
},
{
"file": "assets/Small Blue Button_Pressed.png",
"kind": "image",
"metadata": "",
"name": "assets\\Small Blue Button_Pressed.png",
"smoothed": false,
"userAdded": false,
"origin": {
"identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/Pixel art/9e01b09016c6a200b53a55cac3cf34f083785eb6b9f55de490a71ad352858b36_Small Blue Button_Pressed.png",
"name": "Small Blue Button_Pressed.png"
}
},
{
"file": "assets/8BitOperatorPlus8Regular_Edited.fnt",
"kind": "bitmapFont",
"metadata": "",
"name": "assets\\8BitOperatorPlus8Regular_Edited.fnt",
"userAdded": false,
"origin": {
"identifier": "https://asset-resources.gdevelop.io/public-resources/Menu buttons/Pixel art/6b410f07a3a02e721a49d41795e84b56707ef28ac4d095d55f1fd1093760e134_8BitOperatorPlus8Regular_Edited.fnt",
"name": "8BitOperatorPlus8Regular_Edited.fnt"
}
},
{
"file": "assets/NewSprite.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "NewSprite",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/NewSprite2.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "NewSprite2",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/NewSprite3.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "NewSprite3",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down.png",
"kind": "image",
"metadata": "{\"extension\":\".png\",\"localFilePath\":\"assets/01Down.png\"}",
"name": "01Down",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down2.png",
"kind": "image",
"metadata": "{\"extension\":\".png\",\"localFilePath\":\"assets/01Down2.png\"}",
"name": "01Down2",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down3.png",
"kind": "image",
"metadata": "{\"extension\":\".png\",\"localFilePath\":\"assets/01Down3.png\"}",
"name": "01Down3",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down4.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Down4",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down5.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Down5",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down6.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Down6",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down7.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Down7",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Down8.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Down8",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Left.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Left",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Left2.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Left2",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Left3.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Left3",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Left4.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Left4",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Up.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Up",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Up2.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Up2",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Up3.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Up3",
"smoothed": false,
"userAdded": false
},
{
"file": "assets/01Up4.png",
"kind": "image",
"metadata": "{\"extension\":\".png\"}",
"name": "01Up4",
"smoothed": false,
"userAdded": false
}
]
},
"objects": [
{
"adaptCollisionMaskAutomatically": true,
"assetStoreId": "",
"name": "spr_player",
"persistentUuid": "d03a1af6-4615-4ebe-92c5-a2678ed69ba6",
"type": "Sprite",
"updateIfNotVisible": false,
"variables": [
{
"name": "player_id",
"persistentUuid": "946a6f26-ee26-4e20-811d-9674dc90ace4",
"type": "number",
"value": 0
}
],
"effects": [],
"behaviors": [
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior",
"acceleration": 99999,
"allowDiagonals": false,
"angleOffset": 0,
"angularMaxSpeed": 180,
"customIsometryAngle": 30,
"deceleration": 99999,
"ignoreDefaultControls": false,
"maxSpeed": 200,
"movementAngleOffset": 0,
"rotateObject": false,
"useLegacyTurnBack": false,
"viewpoint": "TopDown"
}
],
"animations": [
{
"name": "NewSprite",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"metadata": "{\"pskl\":{}}",
"timeBetweenFrames": 0.08,
"sprites": [
{
"hasCustomCollisionMask": true,
"image": "NewSprite2",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 0,
"y": 0
},
{
"x": 64,
"y": 0
},
{
"x": 64,
"y": 64
},
{
"x": 0,
"y": 64
}
]
]
}
]
}
]
}
]
},
{
"adaptCollisionMaskAutomatically": true,
"assetStoreId": "",
"name": "spr_otherPlayers",
"persistentUuid": "1a256d41-16be-45af-a2c0-d555c42c2cb0",
"type": "Sprite",
"updateIfNotVisible": false,
"variables": [
{
"name": "player_id",
"persistentUuid": "d4f11f2a-8cdb-4dd0-a45c-393c3de1719a",
"type": "number",
"value": 0
}
],
"effects": [],
"behaviors": [
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior",
"acceleration": 99999,
"allowDiagonals": false,
"angleOffset": 0,
"angularMaxSpeed": 180,
"customIsometryAngle": 30,
"deceleration": 99999,
"ignoreDefaultControls": true,
"maxSpeed": 200,
"movementAngleOffset": 0,
"rotateObject": false,
"useLegacyTurnBack": false,
"viewpoint": "TopDown"
}
],
"animations": [
{
"name": "NewSprite",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"metadata": "{\"pskl\":{}}",
"timeBetweenFrames": 0.08,
"sprites": [
{
"hasCustomCollisionMask": true,
"image": "NewSprite2",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 0,
"y": 0
},
{
"x": 64,
"y": 0
},
{
"x": 64,
"y": 64
},
{
"x": 0,
"y": 64
}
]
]
}
]
}
]
}
]
},
{
"adaptCollisionMaskAutomatically": true,
"assetStoreId": "",
"name": "spr_door",
"persistentUuid": "8b7cf3ce-40c8-4a17-925a-0c70b66838a4",
"type": "Sprite",
"updateIfNotVisible": false,
"variables": [
{
"name": "var_doorway",
"persistentUuid": "06f73534-50b8-404f-9883-0d70149713d7",
"type": "string",
"value": "000001"
}
],
"effects": [],
"behaviors": [],
"animations": [
{
"name": "NewSprite",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"metadata": "{\"pskl\":{}}",
"timeBetweenFrames": 0.08,
"sprites": [
{
"hasCustomCollisionMask": true,
"image": "NewSprite3",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 4,
"y": 3
},
{
"x": 62,
"y": 3
},
{
"x": 62,
"y": 60
},
{
"x": 4,
"y": 60
}
]
]
}
]
}
]
}
]
},
{
"assetStoreId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"name": "btn_Logout",
"persistentUuid": "c920ea77-7ccf-456f-aabb-496c1250d6f1",
"type": "PanelSpriteButton::PanelSpriteButton",
"variant": "Small Blue Button",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"LabelText": "Log Out",
"PressedLabelOffsetY": 2
}
},
{
"assetStoreId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"name": "btn_Fullscreen",
"persistentUuid": "56fd8b1d-175c-4840-97fe-f76e7d829e9f",
"type": "PanelSpriteButton::PanelSpriteButton",
"variant": "Small Blue Button",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"LabelText": "[ ]",
"PressedLabelOffsetY": 2
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "spr_player"
},
{
"objectName": "spr_otherPlayers"
},
{
"objectName": "spr_door"
},
{
"objectName": "btn_Logout"
},
{
"objectName": "btn_Fullscreen"
}
]
},
"objectsGroups": [],
"variables": [
{
"name": "var_playerInfo",
"persistentUuid": "1fb97af7-5f6a-4907-9164-628713a29d54",
"type": "structure",
"children": []
},
{
"name": "var_jsonAddress",
"persistentUuid": "78b897a8-e843-4a0c-be02-63ddb7f70eae",
"type": "string",
"value": "http://192.168.3.250:3000"
},
{
"name": "var_mqttAddress",
"persistentUuid": "0048bbcb-0ca6-4b6e-a90e-be2218ce7a47",
"type": "string",
"value": "192.168.3.250:9001"
},
{
"name": "var_RTC",
"persistentUuid": "1ba271fb-6df8-4662-8e0c-d6554e2702c9",
"type": "structure",
"children": []
},
{
"name": "var_date",
"persistentUuid": "7a18cea8-1a20-46d8-a276-77880277c26a",
"type": "number",
"value": 0
}
],
"layouts": [
{
"b": 255,
"disableInputWhenNotFocused": true,
"mangledName": "Login",
"name": "Login",
"r": 247,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 249,
"uiSettings": {
"grid": true,
"gridType": "rectangular",
"gridWidth": 16,
"gridHeight": 16,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": true,
"zoomFactor": 0.8416428125373118,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"objectsGroups": [],
"variables": [
{
"name": "var_username",
"persistentUuid": "43ebc160-5d2f-4769-8bab-6f2b03b0006b",
"type": "string",
"value": ""
},
{
"name": "var_password",
"persistentUuid": "714571eb-af1a-4f97-aead-d7b9f5de9afb",
"type": "string",
"value": ""
},
{
"name": "var_jsonReply",
"persistentUuid": "2898cef6-8fdf-4718-bf6b-1cdb5e030acb",
"type": "string",
"value": ""
},
{
"name": "var_jsonParse",
"persistentUuid": "5b1b0b96-6ef9-411f-bc42-b287f548f2b6",
"type": "structure",
"children": []
}
],
"instances": [
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txtbx_Username",
"persistentUuid": "632731bc-b1bd-4383-9acd-12cd653efcdf",
"width": 0,
"x": 480,
"y": 192,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txtbx_Password",
"persistentUuid": "44c2f0bc-a292-45be-8cf5-c4d8893b1ed3",
"width": 0,
"x": 480,
"y": 288,
"zOrder": 2,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "btn_Login",
"persistentUuid": "b3d700fe-d3d1-4e3c-8961-1305b2ae4168",
"width": 0,
"x": 560,
"y": 384,
"zOrder": 3,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "btn_Register",
"persistentUuid": "9b8441ec-dfee-4296-bdd5-6e1b0425d56d",
"width": 0,
"x": 560,
"y": 480,
"zOrder": 4,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_lblServerStatus",
"persistentUuid": "2b11514e-c2b0-4bbe-b292-93c3240449d2",
"width": 0,
"x": 32,
"y": 640,
"zOrder": 5,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_lblMQTTStatus",
"persistentUuid": "c02d52f2-3e7a-45ec-ab25-e274a2aba45b",
"width": 0,
"x": 32,
"y": 672,
"zOrder": 6,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_ServerStatus",
"persistentUuid": "178406cc-fe38-44d9-ab83-fac3479e6cba",
"width": 0,
"x": 112,
"y": 640,
"zOrder": 7,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_MQTTStatus",
"persistentUuid": "c4ecc711-8ead-4310-b1b4-4e528d66eab6",
"width": 0,
"x": 112,
"y": 672,
"zOrder": 8,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_gameTitle",
"persistentUuid": "9a6eb8ef-3e39-479e-9631-b2e2cc1fa161",
"width": 0,
"x": 320,
"y": 84,
"zOrder": 10,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_date",
"persistentUuid": "d824c9ba-8961-4047-ba4c-13e66b8f44d3",
"width": 0,
"x": 32,
"y": 16,
"zOrder": 12,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"objects": [
{
"assetStoreId": "",
"name": "txtbx_Username",
"persistentUuid": "c3ee77af-838b-4e52-84e5-9edfdec72fdf",
"type": "TextInput::TextInputObject",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"initialValue": "",
"placeholder": "Username",
"fontResourceName": "",
"fontSize": 20,
"inputType": "text",
"textColor": "0;0;0",
"fillColor": "255;255;255",
"fillOpacity": 255,
"borderColor": "0;0;0",
"borderOpacity": 255,
"borderWidth": 1,
"readOnly": false,
"disabled": false,
"spellCheck": false,
"paddingX": 2,
"paddingY": 1,
"textAlign": "left",
"maxLength": 0
}
},
{
"assetStoreId": "",
"name": "txtbx_Password",
"persistentUuid": "ffd66276-22b2-46bc-bc58-2010837dc5f2",
"type": "TextInput::TextInputObject",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"initialValue": "",
"placeholder": "Password",
"fontResourceName": "",
"fontSize": 20,
"inputType": "password",
"textColor": "0;0;0",
"fillColor": "255;255;255",
"fillOpacity": 255,
"borderColor": "0;0;0",
"borderOpacity": 255,
"borderWidth": 1,
"readOnly": false,
"disabled": false,
"spellCheck": false,
"paddingX": 2,
"paddingY": 1,
"textAlign": "left",
"maxLength": 0
}
},
{
"assetStoreId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"name": "btn_Login",
"persistentUuid": "ae3aaba7-ff4b-463f-bb17-eb233ab5a68c",
"type": "PanelSpriteButton::PanelSpriteButton",
"variant": "Small Blue Button",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"LabelText": "Login",
"PressedLabelOffsetY": 2
}
},
{
"assetStoreId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"name": "btn_Register",
"persistentUuid": "548a436e-bc77-426e-9048-9501732084ed",
"type": "PanelSpriteButton::PanelSpriteButton",
"variant": "Small Blue Button",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"LabelText": "Register",
"PressedLabelOffsetY": 2
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_lblServerStatus",
"persistentUuid": "e45fe9f3-cdc8-4d58-9e6a-ba2b71e3e734",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Server:",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Server:",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_lblMQTTStatus",
"persistentUuid": "a5dcdfbf-e3c2-4853-a7a2-113be9442012",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Broker:",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Broker:",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
},
{
"assetStoreId": "",
"bold": true,
"italic": false,
"name": "txt_ServerStatus",
"persistentUuid": "0f4b8881-8813-490b-9b44-21561d04f0c4",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "OFFLINE",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 255
},
"content": {
"bold": true,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "OFFLINE",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "255;0;0"
}
},
{
"assetStoreId": "",
"bold": true,
"italic": false,
"name": "txt_MQTTStatus",
"persistentUuid": "3dd0f168-5e38-4ae4-955c-1eb13063c3bc",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "OFFLINE",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 255
},
"content": {
"bold": true,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "OFFLINE",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "255;0;0"
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_debug",
"persistentUuid": "00343022-da8d-4af2-8a21-4e1dd750735a",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Text",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Text",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_gameTitle",
"persistentUuid": "574c3ce1-cb11-4dab-a2ec-f195258ed913",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "SQUARE GAME: MULTIPLAYER!",
"font": "",
"textAlignment": "left",
"characterSize": 40,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "SQUARE GAME: MULTIPLAYER!",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 40,
"lineHeight": 0,
"color": "0;0;0"
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_date",
"persistentUuid": "604cf4c5-d211-4b59-bc56-bdf7bf611ca7",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Date",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Date",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "txtbx_Username"
},
{
"objectName": "txtbx_Password"
},
{
"objectName": "btn_Login"
},
{
"objectName": "btn_Register"
},
{
"objectName": "txt_lblServerStatus"
},
{
"objectName": "txt_ServerStatus"
},
{
"objectName": "txt_lblMQTTStatus"
},
{
"objectName": "txt_MQTTStatus"
},
{
"objectName": "txt_debug"
},
{
"objectName": "txt_gameTitle"
},
{
"objectName": "txt_date"
}
]
},
"events": [
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "RegisterButton",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_Register",
""
]
}
],
"actions": [
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"\"Register\"",
""
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Server Status",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SceneJustBegins"
},
"parameters": [
""
]
}
],
"actions": [
{
"type": {
"value": "MQTT::connect"
},
"parameters": [
"",
"var_mqttAddress",
"\"\"",
"",
""
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users\"",
"",
"\"GET\"",
"",
"var_jsonReply",
""
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/server\"",
"",
"\"GET\"",
"",
"var_jsonReply",
""
]
},
{
"type": {
"value": "Wait"
},
"parameters": [
".1"
]
},
{
"type": {
"value": "JSONToVariableStructure2"
},
"parameters": [
"var_jsonReply",
"var_RTC"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_jsonReply",
"!=",
"\"[]\""
]
}
],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"txt_ServerStatus",
"Text",
"=",
"\"ONLINE\""
]
},
{
"type": {
"value": "TextObject::ChangeColor"
},
"parameters": [
"txt_ServerStatus",
"\"0;255;0\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "MQTT::isConnected"
},
"parameters": [
"",
""
]
}
],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"txt_MQTTStatus",
"Text",
"=",
"\"ONLINE\""
]
},
{
"type": {
"value": "TextObject::ChangeColor"
},
"parameters": [
"txt_MQTTStatus",
"\"0;255;0\""
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Log In",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_Login",
""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_Username",
"Text",
"!=",
"\"\""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_Password",
"Text",
"!=",
"\"\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_username",
"=",
"txtbx_Username.Text::Value()"
]
},
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_password",
"=",
"txtbx_Password.Text::Value()"
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users?username=\" + var_username +\"&password=\" + var_password",
"",
"\"GET\"",
"",
"var_jsonReply",
""
]
},
{
"type": {
"value": "Wait"
},
"parameters": [
".1"
]
},
{
"type": {
"value": "JSONToVariableStructure2"
},
"parameters": [
"var_jsonReply",
"var_jsonParse"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_jsonParse[0].username",
"=",
"var_username"
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_jsonParse[0].password",
"=",
"var_password"
]
}
],
"actions": [
{
"type": {
"value": "JSONToVariableStructure2"
},
"parameters": [
"var_jsonReply",
"var_playerInfo"
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users/\"+var_playerInfo[0].id",
"\"{\\\"online\\\":true}\"",
"\"PATCH\"",
"\"application/json\"",
"",
""
]
},
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"\"Logged in\"",
""
]
}
]
}
],
"parameters": []
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_Fullscreen",
""
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "IsFullScreen"
},
"parameters": [
""
]
}
],
"actions": [
{
"type": {
"value": "SetFullScreen"
},
"parameters": [
"",
"yes",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "IsFullScreen"
},
"parameters": [
""
]
}
],
"actions": [
{
"type": {
"value": "SetFullScreen"
},
"parameters": [
"",
"no",
""
]
}
]
}
]
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Date/Time",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"txt_date",
"Text",
"=",
"var_RTC[\"hour\"]+\":\"+var_RTC[\"minute\"]"
]
}
]
}
],
"parameters": []
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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 Ambient Hemisphere Light",
"doubleParameters": {
"elevation": 40,
"intensity": 0.33,
"rotation": 300
},
"stringParameters": {
"groundColor": "127;127;127",
"skyColor": "255;255;255",
"top": "Z+"
},
"booleanParameters": {}
},
{
"effectType": "Scene3D::DirectionalLight",
"name": "3D Sun Light",
"doubleParameters": {
"distanceFromCamera": 1500,
"elevation": 40,
"frustumSize": 4000,
"intensity": 0.75,
"minimumShadowBias": 0,
"rotation": 300
},
"stringParameters": {
"color": "255;255;255",
"shadowQuality": "medium",
"top": "Z+"
},
"booleanParameters": {
"isCastingShadow": true
}
}
]
}
],
"behaviorsSharedData": [
{
"name": "Animation",
"type": "AnimatableCapability::AnimatableBehavior"
},
{
"name": "Effect",
"type": "EffectCapability::EffectBehavior"
},
{
"name": "Flippable",
"type": "FlippableCapability::FlippableBehavior"
},
{
"name": "Opacity",
"type": "OpacityCapability::OpacityBehavior"
},
{
"name": "Resizable",
"type": "ResizableCapability::ResizableBehavior"
},
{
"name": "Scale",
"type": "ScalableCapability::ScalableBehavior"
},
{
"name": "Text",
"type": "TextContainerCapability::TextContainerBehavior"
},
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior"
}
]
},
{
"b": 255,
"disableInputWhenNotFocused": true,
"mangledName": "Register",
"name": "Register",
"r": 247,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 249,
"uiSettings": {
"grid": true,
"gridType": "rectangular",
"gridWidth": 16,
"gridHeight": 16,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": true,
"zoomFactor": 1.528913289223325,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"objectsGroups": [],
"variables": [
{
"name": "var_password01",
"persistentUuid": "9b38d1eb-2fc4-4744-b61a-b901092ab536",
"type": "string",
"value": ""
},
{
"name": "var_password02",
"persistentUuid": "73bfe239-ff40-4b6f-8505-ea724078f6ee",
"type": "string",
"value": ""
},
{
"name": "var_username",
"persistentUuid": "79b2dd33-921b-4817-9e5c-ebaa38a21834",
"type": "string",
"value": ""
},
{
"name": "var_jsonReply",
"persistentUuid": "e4d7e8bd-3595-4aef-9ec7-0fb470bb3ecd",
"type": "string",
"value": "[]"
},
{
"name": "var_jsonParse",
"persistentUuid": "8a602891-d0e3-4492-a2b0-14d0f4fe64fb",
"type": "array",
"children": []
},
{
"name": "var_colorGen",
"persistentUuid": "5381318f-fa30-4456-8351-f814f8ecadbd",
"type": "string",
"value": ""
}
],
"instances": [
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txtbx_regUsername",
"persistentUuid": "66377f44-b1e3-4eab-a9c0-bc3752017e4e",
"width": 0,
"x": 480,
"y": 322,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txtbx_regPassword01",
"persistentUuid": "b2099cad-5ab7-4a38-b939-31869e362657",
"width": 0,
"x": 480,
"y": 368,
"zOrder": 2,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "btn_regRegister",
"persistentUuid": "41a1f2cd-107b-4058-8bc6-eb51487ac180",
"width": 0,
"x": 560,
"y": 480,
"zOrder": 4,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_RegMessageUser",
"persistentUuid": "4b4c3bd0-ffdf-440c-97a6-1992a4ae80d8",
"width": 0,
"x": 512,
"y": 649,
"zOrder": 5,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "btn_Back",
"persistentUuid": "af79ebf6-4ccf-4335-bab9-df40fbb263d8",
"width": 0,
"x": 560,
"y": 560,
"zOrder": 6,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "spr_sqaure",
"persistentUuid": "9c413fc9-26ab-4cc4-b4c8-b84a8ac651ef",
"width": 0,
"x": 592,
"y": 112,
"zOrder": 8,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "btn_NewColor",
"persistentUuid": "248ac7e7-6ac9-4c9f-a7ec-a83df84e6d27",
"width": 0,
"x": 560,
"y": 224,
"zOrder": 9,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txtbx_regPassword02",
"persistentUuid": "7106be72-f61f-4ab7-8659-4b87a1b8668b",
"width": 0,
"x": 480,
"y": 416,
"zOrder": 11,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_RegMessagePassword",
"persistentUuid": "16a3c795-1cfa-4633-bc35-3a823ceaf916",
"width": 0,
"x": 517,
"y": 688,
"zOrder": 12,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_RegMessageSuccess",
"persistentUuid": "268fa5ba-bfd7-467f-80e6-1bf428f66436",
"width": 0,
"x": 521,
"y": 617,
"zOrder": 13,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"objects": [
{
"assetStoreId": "",
"name": "txtbx_regUsername",
"persistentUuid": "5bfb2de7-1947-4660-b896-ccac584f70f5",
"type": "TextInput::TextInputObject",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"initialValue": "",
"placeholder": "Username",
"fontResourceName": "",
"fontSize": 20,
"inputType": "text",
"textColor": "0;0;0",
"fillColor": "255;255;255",
"fillOpacity": 255,
"borderColor": "0;0;0",
"borderOpacity": 255,
"borderWidth": 1,
"readOnly": false,
"disabled": false,
"spellCheck": false,
"paddingX": 2,
"paddingY": 1,
"textAlign": "left",
"maxLength": 0
}
},
{
"assetStoreId": "",
"name": "txtbx_regPassword01",
"persistentUuid": "e32982f7-fc73-4866-9b15-fd09d926a819",
"type": "TextInput::TextInputObject",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"initialValue": "",
"placeholder": "Password",
"fontResourceName": "",
"fontSize": 20,
"inputType": "password",
"textColor": "0;0;0",
"fillColor": "255;255;255",
"fillOpacity": 255,
"borderColor": "0;0;0",
"borderOpacity": 255,
"borderWidth": 1,
"readOnly": false,
"disabled": false,
"spellCheck": false,
"paddingX": 2,
"paddingY": 1,
"textAlign": "left",
"maxLength": 0
}
},
{
"assetStoreId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"name": "btn_regRegister",
"persistentUuid": "f4f70ee8-da7b-4666-8780-a69ad9879791",
"type": "PanelSpriteButton::PanelSpriteButton",
"variant": "Small Blue Button",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"LabelText": "Register",
"PressedLabelOffsetY": 2
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_RegMessageUser",
"persistentUuid": "cb2b72b5-1e20-4241-b4e3-3406a240cb33",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Username is not available",
"font": "",
"textAlignment": "center",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 255
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Username is not available",
"font": "",
"textAlignment": "center",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "255;0;0"
}
},
{
"assetStoreId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"name": "btn_Back",
"persistentUuid": "a735af63-2e06-4548-a596-7eb24268783a",
"type": "PanelSpriteButton::PanelSpriteButton",
"variant": "Small Blue Button",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"LabelText": "Back",
"PressedLabelOffsetY": 2
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_JSONReply",
"persistentUuid": "cde1bbef-cbc8-4fc3-9d5b-d0f2c9e02dec",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "[]",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "[]",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
},
{
"adaptCollisionMaskAutomatically": true,
"assetStoreId": "",
"name": "spr_sqaure",
"persistentUuid": "8e29f65a-9088-4d1e-b7b8-b947d7f9b407",
"type": "Sprite",
"updateIfNotVisible": false,
"variables": [],
"effects": [],
"behaviors": [],
"animations": [
{
"name": "NewSprite",
"useMultipleDirections": false,
"directions": [
{
"looping": false,
"metadata": "{\"pskl\":{}}",
"timeBetweenFrames": 0.08,
"sprites": [
{
"hasCustomCollisionMask": true,
"image": "NewSprite",
"points": [],
"originPoint": {
"name": "origine",
"x": 0,
"y": 0
},
"centerPoint": {
"automatic": true,
"name": "centre",
"x": 0,
"y": 0
},
"customCollisionMask": [
[
{
"x": 0,
"y": 0
},
{
"x": 64,
"y": 0
},
{
"x": 64,
"y": 64
},
{
"x": 0,
"y": 64
}
]
]
}
]
}
]
}
]
},
{
"assetStoreId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"name": "btn_NewColor",
"persistentUuid": "5428983b-7262-40a0-9d70-e7b3aa5d0175",
"type": "PanelSpriteButton::PanelSpriteButton",
"variant": "Small Blue Button",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"LabelText": "New Color",
"PressedLabelOffsetY": 2
}
},
{
"assetStoreId": "",
"name": "txtbx_regPassword02",
"persistentUuid": "5f39eff0-637f-46e3-b032-923b512aaa70",
"type": "TextInput::TextInputObject",
"variables": [],
"effects": [],
"behaviors": [],
"content": {
"initialValue": "",
"placeholder": "Repeat Password",
"fontResourceName": "",
"fontSize": 20,
"inputType": "password",
"textColor": "0;0;0",
"fillColor": "255;255;255",
"fillOpacity": 255,
"borderColor": "0;0;0",
"borderOpacity": 255,
"borderWidth": 1,
"readOnly": false,
"disabled": false,
"spellCheck": false,
"paddingX": 2,
"paddingY": 1,
"textAlign": "left",
"maxLength": 0
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_RegMessagePassword",
"persistentUuid": "366c40cc-d4d1-4858-8b9c-5c959e69c941",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Passwords do not match",
"font": "",
"textAlignment": "center",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 255
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Passwords do not match",
"font": "",
"textAlignment": "center",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "255;0;0"
}
},
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_RegMessageSuccess",
"persistentUuid": "bb5d6c4b-2eb6-4005-a464-2d3392769eb1",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Registration Successful!",
"font": "",
"textAlignment": "center",
"characterSize": 20,
"color": {
"b": 0,
"g": 255,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Registration Successful!",
"font": "",
"textAlignment": "center",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;255;0"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "txtbx_regUsername"
},
{
"objectName": "spr_sqaure"
},
{
"objectName": "txtbx_regPassword01"
},
{
"objectName": "txtbx_regPassword02"
},
{
"objectName": "btn_regRegister"
},
{
"objectName": "btn_Back"
},
{
"objectName": "btn_NewColor"
},
{
"objectName": "txt_RegMessageUser"
},
{
"objectName": "txt_RegMessageSuccess"
},
{
"objectName": "txt_RegMessagePassword"
},
{
"objectName": "txt_JSONReply"
}
]
},
"events": [
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Hide Registration Message/Random Color Gen",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SceneJustBegins"
},
"parameters": [
""
]
}
],
"actions": [
{
"type": {
"value": "Hide"
},
"parameters": [
"txt_RegMessageUser"
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"txt_RegMessagePassword"
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"txt_RegMessageSuccess"
]
},
{
"type": {
"value": "SetCenterX"
},
"parameters": [
"txt_RegMessageUser",
"=",
"btn_Back.CenterX()"
]
},
{
"type": {
"value": "SetCenterX"
},
"parameters": [
"txt_RegMessagePassword",
"=",
"btn_Back.CenterX()"
]
},
{
"type": {
"value": "SetCenterX"
},
"parameters": [
"txt_RegMessageSuccess",
"=",
"btn_Back.CenterX()"
]
},
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_colorGen",
"=",
"ToString(RandomInRange(0,255)) + \";\" + ToString(RandomInRange(0,255)) + \";\" + ToString(RandomInRange(0,255))"
]
},
{
"type": {
"value": "ChangeColor"
},
"parameters": [
"spr_sqaure",
"var_colorGen"
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Back Button",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_Back",
""
]
}
],
"actions": [
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"\"Login\"",
""
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"folded": true,
"name": "Register Button",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Check if username exists"
},
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_regUsername",
"Text",
"!=",
"\"\""
]
},
{
"type": {
"inverted": true,
"value": "TextInput::TextInputObject::Focused"
},
"parameters": [
"txtbx_regUsername"
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_username",
"=",
"txtbx_regUsername.Text::Value()"
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users?username=\" + var_username",
"",
"\"GET\"",
"",
"var_jsonReply",
""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"txt_JSONReply",
"Text",
"=",
"var_jsonReply"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Password Match"
},
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "TextInput::TextInputObject::Focused"
},
"parameters": [
"txtbx_regPassword01"
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_password01",
"=",
"txtbx_regPassword01.Text::Value()"
]
},
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_password02",
"=",
"txtbx_regPassword02.Text::Value()"
]
}
],
"events": [
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_password01",
"!=",
"var_password02"
]
}
],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"txt_RegMessagePassword",
"Text",
"=",
"\"Password do not match\""
]
},
{
"type": {
"value": "Show"
},
"parameters": [
"txt_RegMessagePassword",
""
]
},
{
"type": {
"value": "TextObject::ChangeColor"
},
"parameters": [
"txt_RegMessagePassword",
"\"255;0;0\""
]
},
{
"type": {
"value": "SetCenterX"
},
"parameters": [
"txt_RegMessagePassword",
"=",
"btn_Back.CenterX()"
]
}
]
},
{
"disabled": true,
"type": "BuiltinCommonInstructions::Else",
"conditions": [],
"actions": [
{
"type": {
"value": "Hide"
},
"parameters": [
"txt_RegMessagePassword"
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "If username does not exist, write to database"
},
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_regRegister",
""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_regUsername",
"Text",
"!=",
"\"\""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_regPassword01",
"Text",
"!=",
"\"\""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_jsonReply",
"=",
"\"[]\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_password01",
"=",
"txtbx_regPassword01.Text::Value()"
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users\"",
"\"{\\\"username\\\":\\\"\" + var_username + \"\\\",\\\"password\\\":\\\"\" + var_password01 + \"\\\",\\\"color\\\":\\\"\" + var_colorGen+ \"\\\",\\\"room\\\":\\\"000000\\\"}\"",
"\"POST\"",
"\"application/json\"",
"",
""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"txt_RegMessageUser",
"Text",
"=",
"\"Registration Successful! Please Log In\""
]
},
{
"type": {
"value": "Show"
},
"parameters": [
"txt_RegMessageUser",
""
]
},
{
"type": {
"value": "Wait"
},
"parameters": [
"3"
]
},
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"\"Login\"",
""
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Randomize Color",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_NewColor",
""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_colorGen",
"=",
"ToString(RandomInRange(0,255)) + \";\" + ToString(RandomInRange(0,255)) + \";\" + ToString(RandomInRange(0,255))"
]
},
{
"type": {
"value": "ChangeColor"
},
"parameters": [
"spr_sqaure",
"var_colorGen"
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Registration",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_regRegister",
""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_regUsername",
"Text",
"!=",
"\"\""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_regPassword01",
"Text",
"!=",
"\"\""
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::Value"
},
"parameters": [
"txtbx_regPassword02",
"Text",
"!=",
"\"\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_username",
"=",
"txtbx_regUsername.Text::Value()"
]
},
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_password01",
"=",
"txtbx_regPassword01.Text::Value()"
]
},
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_password02",
"=",
"txtbx_regPassword02.Text::Value()"
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users?username=\" + var_username",
"",
"\"GET\"",
"",
"var_jsonReply",
""
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_password01",
"!=",
"var_password02"
]
}
],
"actions": [
{
"type": {
"value": "Show"
},
"parameters": [
"txt_RegMessagePassword",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Else",
"conditions": [],
"actions": [
{
"type": {
"value": "Hide"
},
"parameters": [
"txt_RegMessagePassword"
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_jsonReply",
"!=",
"\"[]\""
]
}
],
"actions": [
{
"type": {
"value": "Show"
},
"parameters": [
"txt_RegMessageUser",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Else",
"conditions": [],
"actions": [
{
"type": {
"value": "Hide"
},
"parameters": [
"txt_RegMessageUser"
]
},
{
"type": {
"value": "Show"
},
"parameters": [
"txt_RegMessageSuccess",
""
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users\"",
"\"{\\\"username\\\":\\\"\" + var_username + \"\\\",\\\"password\\\":\\\"\" + var_password01 + \"\\\",\\\"color\\\":\\\"\" + var_colorGen + \"\\\",\\\"room\\\":\\\"000000\\\",\\\"last_room\\\":\\\"000000\\\"}\"",
"\"POST\"",
"\"application/json\"",
"",
""
]
},
{
"type": {
"value": "Wait"
},
"parameters": [
"3"
]
},
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"\"Login\"",
""
]
}
]
}
]
}
]
}
],
"parameters": []
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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 Ambient Hemisphere Light",
"doubleParameters": {
"elevation": 40,
"intensity": 0.33,
"rotation": 300
},
"stringParameters": {
"groundColor": "127;127;127",
"skyColor": "255;255;255",
"top": "Z+"
},
"booleanParameters": {}
},
{
"effectType": "Scene3D::DirectionalLight",
"name": "3D Sun Light",
"doubleParameters": {
"distanceFromCamera": 1500,
"elevation": 40,
"frustumSize": 4000,
"intensity": 0.75,
"minimumShadowBias": 0,
"rotation": 300
},
"stringParameters": {
"color": "255;255;255",
"shadowQuality": "medium",
"top": "Z+"
},
"booleanParameters": {
"isCastingShadow": true
}
}
]
}
],
"behaviorsSharedData": [
{
"name": "Animation",
"type": "AnimatableCapability::AnimatableBehavior"
},
{
"name": "Effect",
"type": "EffectCapability::EffectBehavior"
},
{
"name": "Flippable",
"type": "FlippableCapability::FlippableBehavior"
},
{
"name": "Opacity",
"type": "OpacityCapability::OpacityBehavior"
},
{
"name": "Resizable",
"type": "ResizableCapability::ResizableBehavior"
},
{
"name": "Scale",
"type": "ScalableCapability::ScalableBehavior"
},
{
"name": "Text",
"type": "TextContainerCapability::TextContainerBehavior"
},
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior"
}
]
},
{
"b": 255,
"disableInputWhenNotFocused": true,
"mangledName": "Logged_32in",
"name": "Logged in",
"r": 247,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 249,
"uiSettings": {
"grid": true,
"gridType": "rectangular",
"gridWidth": 16,
"gridHeight": 16,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": true,
"zoomFactor": 0.546875,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"objectsGroups": [],
"variables": [
{
"name": "password01",
"persistentUuid": "9b38d1eb-2fc4-4744-b61a-b901092ab536",
"type": "string",
"value": ""
},
{
"name": "password02",
"persistentUuid": "73bfe239-ff40-4b6f-8505-ea724078f6ee",
"type": "string",
"value": ""
},
{
"name": "username",
"persistentUuid": "79b2dd33-921b-4817-9e5c-ebaa38a21834",
"type": "string",
"value": ""
},
{
"name": "var_jsonReply",
"persistentUuid": "e4d7e8bd-3595-4aef-9ec7-0fb470bb3ecd",
"type": "string",
"value": ""
},
{
"name": "var_jsonParsed",
"persistentUuid": "a00f1f38-a6b3-4bd6-a53c-f2f3e63a9055",
"type": "array",
"children": []
}
],
"instances": [
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_loggedIn",
"persistentUuid": "f1b704b5-1bb2-4076-9230-0c0f7551a2d0",
"width": 0,
"x": 576,
"y": 336,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"objects": [
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_loggedIn",
"persistentUuid": "886a7a42-1339-4fc5-971d-67526b782479",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "LOGGED IN!",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "LOGGED IN!",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "txt_loggedIn"
}
]
},
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SceneJustBegins"
},
"parameters": [
""
]
}
],
"actions": [
{
"type": {
"value": "Wait"
},
"parameters": [
"3"
]
},
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"var_playerInfo[0].room",
""
]
}
]
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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 Ambient Hemisphere Light",
"doubleParameters": {
"elevation": 40,
"intensity": 0.33,
"rotation": 300
},
"stringParameters": {
"groundColor": "127;127;127",
"skyColor": "255;255;255",
"top": "Z+"
},
"booleanParameters": {}
},
{
"effectType": "Scene3D::DirectionalLight",
"name": "3D Sun Light",
"doubleParameters": {
"distanceFromCamera": 1500,
"elevation": 40,
"frustumSize": 4000,
"intensity": 0.75,
"minimumShadowBias": 0,
"rotation": 300
},
"stringParameters": {
"color": "255;255;255",
"shadowQuality": "medium",
"top": "Z+"
},
"booleanParameters": {
"isCastingShadow": true
}
}
]
}
],
"behaviorsSharedData": [
{
"name": "Animation",
"type": "AnimatableCapability::AnimatableBehavior"
},
{
"name": "Effect",
"type": "EffectCapability::EffectBehavior"
},
{
"name": "Flippable",
"type": "FlippableCapability::FlippableBehavior"
},
{
"name": "Opacity",
"type": "OpacityCapability::OpacityBehavior"
},
{
"name": "Resizable",
"type": "ResizableCapability::ResizableBehavior"
},
{
"name": "Scale",
"type": "ScalableCapability::ScalableBehavior"
},
{
"name": "Text",
"type": "TextContainerCapability::TextContainerBehavior"
},
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior"
}
]
},
{
"b": 255,
"disableInputWhenNotFocused": true,
"mangledName": "_4800000",
"name": "000000",
"r": 247,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 249,
"uiSettings": {
"grid": true,
"gridType": "rectangular",
"gridWidth": 16,
"gridHeight": 16,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": true,
"zoomFactor": 0.6672773998330006,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"objectsGroups": [],
"variables": [
{
"name": "var_mqttParse",
"persistentUuid": "62bd9deb-3848-4176-9eef-2adf2b38198b",
"type": "structure",
"children": []
},
{
"name": "var_jsonParse",
"persistentUuid": "0563153c-5ac3-487f-ab2a-050e5b806bc7",
"type": "structure",
"children": []
},
{
"name": "var_jsonReply",
"persistentUuid": "f4f4161d-90a5-4937-abfe-755a64fb6f2f",
"type": "string",
"value": ""
},
{
"name": "var_child",
"persistentUuid": "457c6438-da2b-4d26-af01-34653736b679",
"type": "structure",
"children": []
},
{
"name": "var_childName",
"persistentUuid": "a7769c54-2f75-4661-bd4f-af2bf1d036d3",
"type": "string",
"value": ""
}
],
"instances": [
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "spr_door",
"persistentUuid": "1691a9cb-54f2-444c-9c3f-38f4edf26eb6",
"width": 0,
"x": 1168,
"y": 352,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "txt_debug",
"persistentUuid": "9ba688b3-55ca-4771-8b64-7c7e4ff5efac",
"width": 0,
"x": 112,
"y": 624,
"zOrder": 2,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "btn_Logout",
"persistentUuid": "acb3eb14-97fe-4a1c-b4c5-f01b9c7c6eeb",
"width": 0,
"x": 16,
"y": 16,
"zOrder": 3,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"objects": [
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_debug",
"persistentUuid": "73e827f1-d8f8-45e5-95f5-ff8a2715886b",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Text",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Text",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "txt_debug"
}
]
},
"events": [
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Scene Start",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Spawn Logic"
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SceneJustBegins"
},
"parameters": [
""
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_playerInfo[0].last_room",
"=",
"\"null\""
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_player",
"var_playerInfo[0].x",
"var_playerInfo[0].y",
""
]
},
{
"type": {
"value": "SetNumberObjectVariable"
},
"parameters": [
"spr_player",
"player_id",
"=",
"var_playerInfo[0].id"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_playerInfo[0].last_room",
"=",
"\"000000\""
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_player",
"560",
"352",
""
]
},
{
"type": {
"value": "SetNumberObjectVariable"
},
"parameters": [
"spr_player",
"player_id",
"=",
"var_playerInfo[0].id"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_playerInfo[0].last_room",
"=",
"\"000001\""
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_player",
"1088",
"352",
""
]
},
{
"type": {
"value": "SetNumberObjectVariable"
},
"parameters": [
"spr_player",
"player_id",
"=",
"var_playerInfo[0].id"
]
}
]
}
]
}
],
"parameters": []
},
{
"type": "BuiltinCommonInstructions::Link",
"include": {
"includeConfig": 0
},
"target": "Functions"
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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 Ambient Hemisphere Light",
"doubleParameters": {
"elevation": 40,
"intensity": 0.33,
"rotation": 300
},
"stringParameters": {
"groundColor": "127;127;127",
"skyColor": "255;255;255",
"top": "Z+"
},
"booleanParameters": {}
},
{
"effectType": "Scene3D::DirectionalLight",
"name": "3D Sun Light",
"doubleParameters": {
"distanceFromCamera": 1500,
"elevation": 40,
"frustumSize": 4000,
"intensity": 0.75,
"minimumShadowBias": 0,
"rotation": 300
},
"stringParameters": {
"color": "255;255;255",
"shadowQuality": "medium",
"top": "Z+"
},
"booleanParameters": {
"isCastingShadow": true
}
}
]
}
],
"behaviorsSharedData": [
{
"name": "Animation",
"type": "AnimatableCapability::AnimatableBehavior"
},
{
"name": "Effect",
"type": "EffectCapability::EffectBehavior"
},
{
"name": "Flippable",
"type": "FlippableCapability::FlippableBehavior"
},
{
"name": "Opacity",
"type": "OpacityCapability::OpacityBehavior"
},
{
"name": "Resizable",
"type": "ResizableCapability::ResizableBehavior"
},
{
"name": "Scale",
"type": "ScalableCapability::ScalableBehavior"
},
{
"name": "Text",
"type": "TextContainerCapability::TextContainerBehavior"
},
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior"
}
]
},
{
"b": 255,
"disableInputWhenNotFocused": true,
"mangledName": "_4800001",
"name": "000001",
"r": 247,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 249,
"uiSettings": {
"grid": true,
"gridType": "rectangular",
"gridWidth": 16,
"gridHeight": 16,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": true,
"zoomFactor": 0.6672773998329975,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"objectsGroups": [],
"variables": [
{
"name": "var_jsonReply",
"persistentUuid": "600e1cff-2b6c-4e86-aa45-0926f9210a1d",
"type": "string",
"value": ""
},
{
"name": "var_jsonParse",
"persistentUuid": "9b38abfa-427b-4c21-bd59-ddc7057a418e",
"type": "structure",
"children": []
},
{
"name": "var_mqttParse",
"persistentUuid": "5c8c99af-3003-442d-bd7f-d123dea72ac4",
"type": "structure",
"children": []
},
{
"name": "var_child",
"persistentUuid": "fb409cbe-b641-4d67-9c0e-d640b65f7cbe",
"type": "structure",
"children": []
},
{
"name": "var_childName",
"persistentUuid": "dc06c4ec-9998-46e8-97b5-0ae6d6088f1e",
"type": "string",
"value": ""
}
],
"instances": [
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "spr_door",
"persistentUuid": "1691a9cb-54f2-444c-9c3f-38f4edf26eb6",
"width": 0,
"x": 32,
"y": 352,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": [
{
"name": "var_doorway",
"type": "string",
"value": "000000"
}
]
},
{
"angle": 0,
"customSize": false,
"height": 0,
"keepRatio": true,
"layer": "",
"name": "btn_Logout",
"persistentUuid": "7c951776-884b-4af0-a13a-97e5ee085499",
"width": 0,
"x": 16,
"y": 16,
"zOrder": 3,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"objects": [
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_debug",
"persistentUuid": "9ec31fcd-7fdb-4daa-88e5-561ccee06c4c",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Text",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Text",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "txt_debug"
}
]
},
"events": [
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Scene Start",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Spawn Logic"
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SceneJustBegins"
},
"parameters": [
""
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_playerInfo[0].last_room",
"=",
"\"null\""
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_player",
"var_playerInfo[0].x",
"var_playerInfo[0].y",
""
]
},
{
"type": {
"value": "SetNumberObjectVariable"
},
"parameters": [
"spr_player",
"player_id",
"=",
"var_playerInfo[0].id"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_playerInfo[0].last_room",
"=",
"\"000001\""
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_player",
"1088",
"352",
""
]
},
{
"type": {
"value": "SetNumberObjectVariable"
},
"parameters": [
"spr_player",
"player_id",
"=",
"var_playerInfo[0].id"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_playerInfo[0].last_room",
"=",
"\"000000\""
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_player",
"112",
"352",
""
]
}
]
}
]
}
],
"parameters": []
},
{
"type": "BuiltinCommonInstructions::Link",
"include": {
"includeConfig": 0
},
"target": "Functions"
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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 Ambient Hemisphere Light",
"doubleParameters": {
"elevation": 40,
"intensity": 0.33,
"rotation": 300
},
"stringParameters": {
"groundColor": "127;127;127",
"skyColor": "255;255;255",
"top": "Z+"
},
"booleanParameters": {}
},
{
"effectType": "Scene3D::DirectionalLight",
"name": "3D Sun Light",
"doubleParameters": {
"distanceFromCamera": 1500,
"elevation": 40,
"frustumSize": 4000,
"intensity": 0.75,
"minimumShadowBias": 0,
"rotation": 300
},
"stringParameters": {
"color": "255;255;255",
"shadowQuality": "medium",
"top": "Z+"
},
"booleanParameters": {
"isCastingShadow": true
}
}
]
}
],
"behaviorsSharedData": [
{
"name": "Animation",
"type": "AnimatableCapability::AnimatableBehavior"
},
{
"name": "Effect",
"type": "EffectCapability::EffectBehavior"
},
{
"name": "Flippable",
"type": "FlippableCapability::FlippableBehavior"
},
{
"name": "Opacity",
"type": "OpacityCapability::OpacityBehavior"
},
{
"name": "Resizable",
"type": "ResizableCapability::ResizableBehavior"
},
{
"name": "Scale",
"type": "ScalableCapability::ScalableBehavior"
},
{
"name": "Text",
"type": "TextContainerCapability::TextContainerBehavior"
},
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior"
}
]
},
{
"b": 255,
"disableInputWhenNotFocused": true,
"mangledName": "Functions",
"name": "Functions",
"r": 247,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 249,
"uiSettings": {
"grid": false,
"gridType": "rectangular",
"gridWidth": 32,
"gridHeight": 32,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": false,
"zoomFactor": 0.546875,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"objectsGroups": [],
"variables": [
{
"name": "var_jsonReply",
"persistentUuid": "e04c3e03-0cb7-4e3d-8f02-7bd32268195c",
"type": "string",
"value": ""
},
{
"name": "var_jsonParse",
"persistentUuid": "becd4ac5-49ec-4fd7-b926-45259680bb42",
"type": "structure",
"children": []
},
{
"name": "var_mqttParse",
"persistentUuid": "b4fe2c70-e8ab-4665-9d0a-7126bb52f64b",
"type": "structure",
"children": []
},
{
"name": "var_child",
"persistentUuid": "64d0682b-fde0-404e-9b34-17034c997c4c",
"type": "structure",
"children": []
},
{
"name": "var_childName",
"persistentUuid": "792ced2c-6b39-44d1-8550-02127dd84b45",
"type": "string",
"value": ""
}
],
"instances": [],
"objects": [
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "txt_debug",
"persistentUuid": "29da99d2-6fb0-4d86-841b-b57124673767",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [],
"string": "Text",
"font": "",
"textAlignment": "left",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Text",
"font": "",
"textAlignment": "left",
"verticalTextAlignment": "top",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "txt_debug"
}
]
},
"events": [
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Scene Start",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SceneJustBegins"
},
"parameters": [
""
]
}
],
"actions": [
{
"type": {
"value": "ChangeColor"
},
"parameters": [
"spr_player",
"var_playerInfo[0].color"
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users/\"+var_playerInfo[0].id",
"\"{\\\"x\\\":\\\"\" + ToString(round(spr_player.X()))+ \"\\\",\\\"y\\\":\\\"\" + ToString(round(spr_player.Y())) + \"\\\"}\"",
"\"PATCH\"",
"\"application/json\"",
"",
""
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users?online=true&room=\"+CurrentSceneName()",
"",
"\"GET\"",
"",
"var_jsonReply",
""
]
},
{
"type": {
"value": "Wait"
},
"parameters": [
".1"
]
},
{
"type": {
"value": "JSONToVariableStructure2"
},
"parameters": [
"var_jsonReply",
"var_jsonParse"
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::ForEachChildVariable",
"iterableVariableName": "var_jsonParse",
"valueIteratorVariableName": "var_child",
"keyIteratorVariableName": "var_childName",
"conditions": [],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_child[\"id\"]",
"!=",
"var_playerInfo[0].id"
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_otherPlayers",
"var_child[\"x\"]",
"var_child[\"y\"]",
""
]
},
{
"type": {
"value": "ChangeColor"
},
"parameters": [
"spr_otherPlayers",
"var_child[\"color\"]"
]
},
{
"type": {
"value": "SetNumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_child[\"id\"]"
]
}
]
}
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "MQTT",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "MQTT::isConnected"
},
"parameters": [
"",
""
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "MQTT::subscribe"
},
"parameters": [
"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"no",
""
]
},
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"join\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \",\\\"x\\\":\" + ToString(round(spr_player.X())) + \",\\\"y\\\":\" + ToString(round(spr_player.Y())) + \",\\\"color\\\":\\\"\" + var_playerInfo[0].color + \"\\\"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "MQTT on button press"
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "TopDownMovementBehavior::IsMoving"
},
"parameters": [
"spr_player",
"TopDownMovement"
]
},
{
"type": {
"value": "TopDownMovementBehavior::TopDownMovementBehavior::IsMovementAngleAround"
},
"parameters": [
"spr_player",
"TopDownMovement",
"0",
"0"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"move_start\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \",\\\"direction\\\":\\\"right\\\"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "TopDownMovementBehavior::IsMoving"
},
"parameters": [
"spr_player",
"TopDownMovement"
]
},
{
"type": {
"value": "TopDownMovementBehavior::TopDownMovementBehavior::IsMovementAngleAround"
},
"parameters": [
"spr_player",
"TopDownMovement",
"90",
"0"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"move_start\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \",\\\"direction\\\":\\\"down\\\"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "TopDownMovementBehavior::IsMoving"
},
"parameters": [
"spr_player",
"TopDownMovement"
]
},
{
"type": {
"value": "TopDownMovementBehavior::TopDownMovementBehavior::IsMovementAngleAround"
},
"parameters": [
"spr_player",
"TopDownMovement",
"180",
"0"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"move_start\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \",\\\"direction\\\":\\\"left\\\"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "TopDownMovementBehavior::IsMoving"
},
"parameters": [
"spr_player",
"TopDownMovement"
]
},
{
"type": {
"value": "TopDownMovementBehavior::TopDownMovementBehavior::IsMovementAngleAround"
},
"parameters": [
"spr_player",
"TopDownMovement",
"270",
"0"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"move_start\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \",\\\"direction\\\":\\\"up\\\"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "TopDownMovementBehavior::IsMoving"
},
"parameters": [
"spr_player",
"TopDownMovement"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"move_stop\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \",\\\"x\\\":\" + ToString(round(spr_player.X())) + \",\\\"y\\\":\" + ToString(round(spr_player.Y())) + \"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "MQTT::onMessage"
},
"parameters": [
"",
"\"/game/rooms/\"+CurrentSceneName()",
""
]
}
],
"actions": [
{
"type": {
"value": "JSONToVariableStructure2"
},
"parameters": [
"MQTT::GetLastMessage(\"/game/rooms/\"+CurrentSceneName())",
"var_mqttParse"
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"txt_debug",
"Text",
"=",
"MQTT::GetLastMessage(\"/game/rooms/\"+CurrentSceneName())"
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"player_id\"]",
"!=",
"var_playerInfo[0].id"
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"type\"]",
"=",
"\"move_start\""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"direction\"]",
"=",
"\"right\""
]
},
{
"type": {
"value": "NumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_mqttParse[\"player_id\"]"
]
}
],
"actions": [
{
"type": {
"value": "ClearForces"
},
"parameters": [
"spr_otherPlayers"
]
},
{
"type": {
"value": "AddForceXY"
},
"parameters": [
"spr_otherPlayers",
"200",
"0",
"1"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"type\"]",
"=",
"\"move_start\""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"direction\"]",
"=",
"\"left\""
]
},
{
"type": {
"value": "NumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_mqttParse[\"player_id\"]"
]
}
],
"actions": [
{
"type": {
"value": "ClearForces"
},
"parameters": [
"spr_otherPlayers"
]
},
{
"type": {
"value": "AddForceXY"
},
"parameters": [
"spr_otherPlayers",
"-200",
"0",
"1"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"type\"]",
"=",
"\"move_start\""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"direction\"]",
"=",
"\"up\""
]
},
{
"type": {
"value": "NumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_mqttParse[\"player_id\"]"
]
}
],
"actions": [
{
"type": {
"value": "ClearForces"
},
"parameters": [
"spr_otherPlayers"
]
},
{
"type": {
"value": "AddForceXY"
},
"parameters": [
"spr_otherPlayers",
"0",
"-200",
"1"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"type\"]",
"=",
"\"move_start\""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"direction\"]",
"=",
"\"down\""
]
},
{
"type": {
"value": "NumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_mqttParse[\"player_id\"]"
]
}
],
"actions": [
{
"type": {
"value": "ClearForces"
},
"parameters": [
"spr_otherPlayers"
]
},
{
"type": {
"value": "AddForceXY"
},
"parameters": [
"spr_otherPlayers",
"0",
"200",
"1"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"type\"]",
"=",
"\"move_stop\""
]
},
{
"type": {
"value": "NumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_mqttParse[\"player_id\"]"
]
}
],
"actions": [
{
"type": {
"value": "ClearForces"
},
"parameters": [
"spr_otherPlayers"
]
},
{
"type": {
"value": "SetXY"
},
"parameters": [
"spr_otherPlayers",
"=",
"var_mqttParse[\"x\"]",
"=",
"var_mqttParse[\"y\"]"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"type\"]",
"=",
"\"join\""
]
}
],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"spr_otherPlayers",
"var_mqttParse[\"x\"]",
"var_mqttParse[\"y\"]",
""
]
},
{
"type": {
"value": "SetNumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_mqttParse[\"player_id\"]"
]
},
{
"type": {
"value": "ChangeColor"
},
"parameters": [
"spr_otherPlayers",
"var_mqttParse[\"color\"]"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"var_mqttParse[\"type\"]",
"=",
"\"leave\""
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::ForEach",
"object": "spr_otherPlayers",
"conditions": [
{
"type": {
"value": "NumberObjectVariable"
},
"parameters": [
"spr_otherPlayers",
"player_id",
"=",
"var_mqttParse[\"player_id\"]"
]
}
],
"actions": [
{
"type": {
"value": "Delete"
},
"parameters": [
"spr_otherPlayers",
""
]
}
]
}
]
}
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Doorways",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "CollisionNP"
},
"parameters": [
"spr_player",
"spr_door",
"",
"",
""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_playerInfo[0].last_room",
"=",
"var_playerInfo[0].room"
]
},
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"var_playerInfo[0].room",
"=",
"spr_door.var_doorway"
]
},
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users/\"+var_playerInfo[0].id",
"\"{\\\"room\\\":\\\"\" + var_playerInfo[0].room + \"\\\",\\\"last_room\\\":\\\"\" + var_playerInfo[0].last_room + \"\\\"}\"",
"\"PATCH\"",
"\"application/json\"",
"",
""
]
},
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"leave\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
},
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"spr_door.var_doorway",
""
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Log Out",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsClicked"
},
"parameters": [
"btn_Logout",
""
]
}
],
"actions": [
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users/\"+var_playerInfo[0].id",
"\"{\\\"online\\\":false,\\\"last_room\\\":\\\"null\\\",\\\"x\\\":\" + ToString(round(spr_player.X())) + \",\\\"y\\\":\" + ToString(round(spr_player.Y())) + \"}\"",
"\"PATCH\"",
"\"application/json\"",
"",
""
]
},
{
"type": {
"value": "MQTT::publish"
},
"parameters": [
"",
"\"{\\\"type\\\":\\\"leave\\\",\\\"player_id\\\":\" + ToString(var_playerInfo[0].id) + \"}\"",
"\"/game/rooms/\"+CurrentSceneName()",
"",
"",
""
]
},
{
"type": {
"value": "Scene"
},
"parameters": [
"",
"\"Login\"",
""
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Update XY",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "TopDownMovementBehavior::IsMoving"
},
"parameters": [
"spr_player",
"TopDownMovement"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "SendAsyncRequest"
},
"parameters": [
"var_jsonAddress+\"/users/\"+var_playerInfo[0].id",
"\"{\\\"x\\\":\\\"\" + ToString(round(spr_player.X()))+ \"\\\",\\\"y\\\":\\\"\" + ToString(round(spr_player.Y())) + \"\\\"}\"",
"\"PATCH\"",
"\"application/json\"",
"",
""
]
}
]
}
],
"parameters": []
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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 Ambient Hemisphere Light",
"doubleParameters": {
"elevation": 40,
"intensity": 0.33,
"rotation": 300
},
"stringParameters": {
"groundColor": "127;127;127",
"skyColor": "255;255;255",
"top": "Z+"
},
"booleanParameters": {}
},
{
"effectType": "Scene3D::DirectionalLight",
"name": "3D Sun Light",
"doubleParameters": {
"distanceFromCamera": 1500,
"elevation": 40,
"frustumSize": 4000,
"intensity": 0.75,
"minimumShadowBias": 0,
"rotation": 300
},
"stringParameters": {
"color": "255;255;255",
"shadowQuality": "medium",
"top": "Z+"
},
"booleanParameters": {
"isCastingShadow": true
}
}
]
}
],
"behaviorsSharedData": [
{
"name": "Animation",
"type": "AnimatableCapability::AnimatableBehavior"
},
{
"name": "Effect",
"type": "EffectCapability::EffectBehavior"
},
{
"name": "Flippable",
"type": "FlippableCapability::FlippableBehavior"
},
{
"name": "Opacity",
"type": "OpacityCapability::OpacityBehavior"
},
{
"name": "Resizable",
"type": "ResizableCapability::ResizableBehavior"
},
{
"name": "Scale",
"type": "ScalableCapability::ScalableBehavior"
},
{
"name": "Text",
"type": "TextContainerCapability::TextContainerBehavior"
},
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior"
}
]
},
{
"b": 255,
"disableInputWhenNotFocused": true,
"mangledName": "Sprite_32Test",
"name": "Sprite Test",
"r": 247,
"standardSortMethod": true,
"stopSoundsOnStartup": true,
"title": "",
"v": 249,
"uiSettings": {
"grid": false,
"gridType": "rectangular",
"gridWidth": 32,
"gridHeight": 32,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": false,
"zoomFactor": 0.546875,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"objectsGroups": [],
"variables": [],
"instances": [],
"objects": [],
"objectsFolderStructure": {
"folderName": "__ROOT"
},
"events": [],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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 Ambient Hemisphere Light",
"doubleParameters": {
"elevation": 40,
"intensity": 0.33,
"rotation": 300
},
"stringParameters": {
"groundColor": "127;127;127",
"skyColor": "255;255;255",
"top": "Z+"
},
"booleanParameters": {}
},
{
"effectType": "Scene3D::DirectionalLight",
"name": "3D Sun Light",
"doubleParameters": {
"distanceFromCamera": 1500,
"elevation": 40,
"frustumSize": 4000,
"intensity": 0.75,
"minimumShadowBias": 0,
"rotation": 300
},
"stringParameters": {
"color": "255;255;255",
"shadowQuality": "medium",
"top": "Z+"
},
"booleanParameters": {
"isCastingShadow": true
}
}
]
}
],
"behaviorsSharedData": [
{
"name": "Animation",
"type": "AnimatableCapability::AnimatableBehavior"
},
{
"name": "Effect",
"type": "EffectCapability::EffectBehavior"
},
{
"name": "Flippable",
"type": "FlippableCapability::FlippableBehavior"
},
{
"name": "Opacity",
"type": "OpacityCapability::OpacityBehavior"
},
{
"name": "Resizable",
"type": "ResizableCapability::ResizableBehavior"
},
{
"name": "Scale",
"type": "ScalableCapability::ScalableBehavior"
},
{
"name": "TopDownMovement",
"type": "TopDownMovementBehavior::TopDownMovementBehavior"
}
]
}
],
"externalEvents": [],
"eventsFunctionsExtensions": [
{
"author": "Arthur Pacaud (@arthuro555)",
"category": "Network",
"dimension": "",
"extensionNamespace": "",
"fullName": "MQTT Client (advanced)",
"gdevelopVersion": ">=5.5.222",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1lc3NhZ2UtZmxhc2giIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMjIgNEMyMiAyLjkgMjEuMSAyIDIwIDJINEMyLjkgMiAyIDIuOSAyIDRWMjJMNiAxOEgxNVYxMEgyMlY0TTIyLjUgMTZIMjAuM0wyMiAxMkgxN1YxOEgxOVYyM0wyMi41IDE2WiIgLz48L3N2Zz4=",
"name": "MQTT",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/message-flash.svg",
"shortDescription": "MQTT client: connect to broker, publish/subscribe topics, send/receive messages.",
"version": "1.0.1",
"description": [
"This extension wraps [MQTT.js](https://github.com/mqttjs/MQTT.js) to allow connections to a MQTT server and communication via pub/sub. The only transport method is Websockets. Make sure to use a broker that support those!",
"",
"## Dataloss",
"",
"The dataloss let you chose how to handle data. Due to how the GDevelop event loop is made, only one message per topic can be processed per frame. When dataloss is on, when you get 2 messages from one topic in one frame, only the latest one is remembered. When it is off, the first message is processed and the second is queued for the next frame.",
"",
"## QoS (Quality of service)",
"",
"Here is how QoS works:",
"",
" - QoS 0 (received at most once): The packet is sent, and that's it. There is no validation about whether it has been received.",
" - QoS 1 (received at least once): The packet is sent and stored as long as the client has not received a confirmation from the server. MQTT ensures that it will be received, but there can be duplicates.",
" - QoS 2 (received exactly once): Same as QoS 1 but there is no duplicates.",
"",
"About data consumption: QoS 2 will consume more than QoS 1, which will consume more than QoS 0.",
"",
"## Test Broker",
"",
"You can find a free test broker server over at https://test.mosquitto.org/ - keep in mind, anyone can read and write data sent there, and it offers no uptime guarantees!"
],
"origin": {
"identifier": "MQTT",
"name": "gdevelop-extension-store"
},
"tags": [
"mqtt",
"iot",
"connection",
"networking",
"pubsub",
"messaging",
"online",
"connect",
"multiplayer",
"send",
"message",
"recieve",
"notify",
"notification",
"home assistant",
"smart home",
"control"
],
"authorIds": [
"ZgrsWuRTAkXgeuPV9bo0zuEcA2w1"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"fullName": "",
"functionType": "Action",
"name": "onFirstSceneLoaded",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"/**",
" * @typedef MQTTEvent Corresponds to a message coming from a subcribed topic.",
" * @property {boolean} loss Descibes how to handle multiple packages in one frame.",
" * @property {string || Array<string>} data The last message received by that event.",
" */",
"",
"/**",
" * The mqtt tools",
" * @namespace",
" */",
"gdjs.evtTools.mqtt = {",
" /** The current connection to the MQTT broker server */",
" connection: null,",
" /** ",
" * The last error that occured ",
" * @type {string}",
" */",
" lastError: \"\",",
" /**",
" * A list of events triggered.",
" * @type {Object.<string, MQTTEvent>}",
" */",
" events: {},",
" empty: Symbol(\"No event\"),",
"};",
"",
"// MQTT.js: https://github.com/mqttjs/MQTT.js (v5.10.3)",
"window.mqtt=(()=>{var ys=Object.defineProperty;var Kg=Object.getOwnPropertyDescriptor;var Gg=Object.getOwnPropertyNames;var Qg=Object.prototype.hasOwnProperty;var _e=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jt=(t,e)=>{for(var r in e)ys(t,r,{get:e[r],enumerable:!0})},Yg=(t,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let n of Gg(e))!Qg.call(t,n)&&n!==r&&ys(t,n,{get:()=>e[n],enumerable:!(i=Kg(e,n))||i.enumerable});return t};var X=t=>Yg(ys({},\"__esModule\",{value:!0}),t);var _=_e(()=>{});var B={};Jt(B,{_debugEnd:()=>yu,_debugProcess:()=>gu,_events:()=>Ou,_eventsCount:()=>xu,_exiting:()=>Yl,_fatalExceptions:()=>cu,_getActiveHandles:()=>eu,_getActiveRequests:()=>Zl,_kill:()=>ru,_linkedBinding:()=>Gl,_maxListeners:()=>ku,_preload_modules:()=>Cu,_rawDebug:()=>zl,_startProfilerIdleNotifier:()=>bu,_stopProfilerIdleNotifier:()=>wu,_tickCallback:()=>pu,abort:()=>Eu,addListener:()=>Mu,allowedNodeEnvironmentFlags:()=>lu,arch:()=>xl,argv:()=>Ul,argv0:()=>Ru,assert:()=>uu,binding:()=>Fl,chdir:()=>Hl,config:()=>Jl,cpuUsage:()=>$i,cwd:()=>$l,debugPort:()=>Tu,default:()=>$u,dlopen:()=>Xl,domain:()=>Ql,emit:()=>Du,emitWarning:()=>jl,env:()=>Ll,execArgv:()=>Nl,execPath:()=>Iu,exit:()=>ou,features:()=>fu,hasUncaughtExceptionCaptureCallback:()=>du,hrtime:()=>Wi,kill:()=>su,listeners:()=>Wu,memoryUsage:()=>nu,moduleLoadList:()=>Kl,nextTick:()=>Pl,off:()=>Uu,on:()=>wt,once:()=>Lu,openStdin:()=>au,pid:()=>Su,platform:()=>Ml,ppid:()=>Au,prependListener:()=>ju,prependOnceListener:()=>Fu,reallyExit:()=>tu,release:()=>Vl,removeAllListeners:()=>qu,removeListener:()=>Nu,resourceUsage:()=>iu,setSourceMapsEnabled:()=>Bu,setUncaughtExceptionCaptureCallback:()=>hu,stderr:()=>mu,stdin:()=>vu,stdout:()=>_u,title:()=>Ol,umask:()=>Wl,uptime:()=>Pu,version:()=>ql,versions:()=>Dl});function _s(t){throw new Error(\"Node.js process \"+t+\" is not supported by JSPM core outside of Node.js\")}function Jg(){!Lr||!Xt||(Lr=!1,Xt.length?bt=Xt.concat(bt):Fi=-1,bt.length&&Bl())}function Bl(){if(!Lr){var t=setTimeout(Jg,0);Lr=!0;for(var e=bt.length;e;){for(Xt=bt,bt=[];++Fi<e;)Xt&&Xt[Fi].run();Fi=-1,e=bt.length}Xt=null,Lr=!1,clearTimeout(t)}}function Pl(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];bt.push(new kl(t,e)),bt.length===1&&!Lr&&setTimeout(Bl,0)}function kl(t,e){this.fun=t,this.array=e}function Ee(){}function Gl(t){_s(\"_linkedBinding\")}function Xl(t){_s(\"dlopen\")}function Zl(){return[]}function eu(){return[]}function uu(t,e){if(!t)throw new Error(e||\"assertion error\")}function du(){return!1}function Pu(){return Lt.now()/1e3}function Wi(t){var e=Math.floor((Date.now()-Lt.now())*.001),r=Lt.now()*.001,i=Math.floor(r)+e,n=Math.floor(r%1*1e9);return t&&(i=i-t[0],n=n-t[1],n<0&&(i--,n+=ws)),[i,n]}function wt(){return $u}function Wu(t){return[]}var bt,Lr,Xt,Fi,Ol,xl,Ml,Ll,Ul,Nl,ql,Dl,jl,Fl,Wl,$l,Hl,Vl,zl,Kl,Ql,Yl,Jl,tu,ru,$i,iu,nu,su,ou,au,lu,fu,cu,hu,pu,gu,yu,bu,wu,_u,mu,vu,Eu,Su,Au,Iu,Tu,Ru,Cu,Bu,Lt,bs,ws,ku,Ou,xu,Mu,Lu,Uu,Nu,qu,Du,ju,Fu,$u,Hu=_e(()=>{_();v();m();bt=[],Lr=!1,Fi=-1;kl.prototype.run=function(){this.fun.apply(null,this.array)};Ol=\"browser\",xl=\"x64\",Ml=\"browser\",Ll={PATH:\"/usr/bin\",LANG:navigator.language+\".UTF-8\",PWD:\"/\",HOME:\"/home\",TMP:\"/tmp\"},Ul=[\"/usr/bin/node\"],Nl=[],ql=\"v16.8.0\",Dl={},jl=function(t,e){console.warn((e?e+\": \":\"\")+t)},Fl=function(t){_s(\"binding\")},Wl=function(t){return 0},$l=function(){return\"/\"},Hl=function(t){},Vl={name:\"node\",sourceUrl:\"\",headersUrl:\"\",libUrl:\"\"};zl=Ee,Kl=[];Ql={},Yl=!1,Jl={};tu=Ee,ru=Ee,$i=function(){return{}},iu=$i,nu=$i,su=Ee,ou=Ee,au=Ee,lu={};fu={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},cu=Ee,hu=Ee;pu=Ee,gu=Ee,yu=Ee,bu=Ee,wu=Ee,_u=void 0,mu=void 0,vu=void 0,Eu=Ee,Su=2,Au=1,Iu=\"/bin/usr/node\",Tu=9229,Ru=\"node\",Cu=[],Bu=Ee,Lt={now:typeof performance<\"u\"?performance.now.bind(performance):void 0,timing:typeof performance<\"u\"?performance.timing:void 0};Lt.n
"`;super(r),this.name=\"AggregateError\",this.errors=e}};Ss.exports={AggregateError:Es,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i===\"f\"?n.toFixed(6):i===\"j\"?JSON.stringify(n):i===\"s\"&&typeof n==\"object\"?`${n.constructor!==Object?n.constructor.name:\"\"} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case\"string\":if(t.includes(\"'\"))if(t.includes('\"')){if(!t.includes(\"`\")&&!t.includes(\"${\"))return`\\`${t}\\``}else return`\"${t}\"`;return`'${t}'`;case\"number\":return isNaN(t)?\"NaN\":Object.is(t,-0)?String(t):t;case\"bigint\":return`${String(t)}n`;case\"boolean\":case\"undefined\":return String(t);case\"object\":return\"{}\"}},types:{isAsyncFunction(t){return t instanceof ny},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:sy};Ss.exports.promisify.custom=Symbol.for(\"nodejs.util.promisify.custom\")});var zi=M((qA,Vi)=>{\"use strict\";_();v();m();var{AbortController:Ju,AbortSignal:oy}=typeof self<\"u\"?self:typeof window<\"u\"?window:void 0;Vi.exports=Ju;Vi.exports.AbortSignal=oy;Vi.exports.default=Ju});var Ae=M((VA,ef)=>{\"use strict\";_();v();m();var{format:ay,inspect:Ki,AggregateError:ly}=Je(),uy=globalThis.AggregateError||ly,fy=Symbol(\"kIsNodeError\"),cy=[\"string\",\"function\",\"number\",\"object\",\"Function\",\"Object\",\"boolean\",\"bigint\",\"symbol\"],hy=/^([A-Z][a-z0-9]*)+$/,dy=\"__node_internal_\",Gi={};function er(t,e){if(!t)throw new Gi.ERR_INTERNAL_ASSERTION(e)}function Xu(t){let e=\"\",r=t.length,i=t[0]===\"-\"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function py(t,e,r){if(typeof e==\"function\")return er(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return er(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:ay(e,...r)}function ve(t,e,r){r||(r=Error);class i extends r{constructor(...o){super(py(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[fy]=!0,Gi[t]=i}function Zu(t){let e=dy+t.name;return Object.defineProperty(t,\"name\",{value:e}),t}function gy(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new uy([e,t],e.message);return r.code=e.code,r}return t||e}var As=class extends Error{constructor(e=\"The operation was aborted\",r=void 0){if(r!==void 0&&typeof r!=\"object\")throw new Gi.ERR_INVALID_ARG_TYPE(\"options\",\"Object\",r);super(e,r),this.code=\"ABORT_ERR\",this.name=\"AbortError\"}};ve(\"ERR_ASSERTION\",\"%s\",Error);ve(\"ERR_INVALID_ARG_TYPE\",(t,e,r)=>{er(typeof t==\"string\",\"'name' must be a string\"),Array.isArray(e)||(e=[e]);let i=\"The \";t.endsWith(\" argument\")?i+=`${t} `:i+=`\"${t}\" ${t.includes(\".\")?\"property\":\"argument\"} `,i+=\"must be \";let n=[],o=[],s=[];for(let l of e)er(typeof l==\"string\",\"All expected entries have to be of type string\"),cy.includes(l)?n.push(l.toLowerCase()):hy.test(l)?o.push(l):(er(l!==\"object\",'The value \"object\" should be written as \"Object\"'),s.push(l));if(o.length>0){let l=n.indexOf(\"object\");l!==-1&&(n.splice(n,l,1),o.push(\"Object\"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();i+=`one of type ${n.join(\", \")}, or ${l}`}}(o.length>0||s.length>0)&&(i+=\" or \")}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0
"`)&&(e=e.replace(CE,\"%0A\")),e.includes(\"\\r\")&&(e=e.replace(BE,\"%0D\")),e.includes(\"\t\")&&(e=e.replace(PE,\"%09\")),i.pathname=e,i}function dg(t){if(typeof t==\"string\")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData(\"invalid argument path , must be a string or URL\");if(t.protocol!==\"file:\")throw new Deno.errors.InvalidData(\"invalid url scheme\");return sl?XE(t):ZE(t)}function XE(t){let e=t.hostname,r=t.pathname;for(let i=0;i<r.length;i++)if(r[i]===\"%\"){let n=r.codePointAt(i+2)||32;if(r[i+1]===\"2\"&&n===102||r[i+1]===\"5\"&&n===99)throw new Deno.errors.InvalidData(\"must not include encoded \\\\ or / characters\")}if(r=r.replace(zE,\"\\\\\"),r=decodeURIComponent(r),e!==\"\")return`\\\\\\\\${e}${r}`;{let i=r.codePointAt(1)|32,n=r[2];if(i<HE||i>VE||n!==\":\")throw new Deno.errors.InvalidData(\"file url path must be absolute\");return r.slice(1)}}function ZE(t){if(t.hostname!==\"\")throw new Deno.errors.InvalidData(\"invalid file url hostname\");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]===\"%\"){let i=e.codePointAt(r+2)||32;if(e[r+1]===\"2\"&&i===102)throw new Deno.errors.InvalidData(\"must not include encoded / characters\")}return decodeURIComponent(e)}function pg(t){let e=Za.resolve(t),r=t.charCodeAt(t.length-1);(r===$E||sl&&r===WE)&&e[e.length-1]!==Za.sep&&(e+=\"/\");let i=new URL(\"file://\");return e.includes(\"%\")&&(e=e.replace(KE,\"%25\")),!sl&&e.includes(\"\\\\\")&&(e=e.replace(GE,\"%5C\")),e.includes(`",
"`)&&(e=e.replace(QE,\"%0A\")),e.includes(\"\\r\")&&(e=e.replace(YE,\"%0D\")),e.includes(\"\t\")&&(e=e.replace(JE,\"%09\")),i.pathname=e,i}var Z,hE,gt,dE,pE,gE,yE,il,lg,ug,fg,bE,wE,el,ai,tl,rl,cg,hg,mE,vE,EE,SE,AE,nl,IE,TE,RE,CE,BE,PE,LE,UE,NE,qE,DE,jE,FE,WE,$E,HE,VE,sl,zE,KE,GE,QE,YE,JE,yg=_e(()=>{_();v();m();Xp();Zp();ng();ag();Ja();Z={},hE=Kt,gt={isString:function(t){return typeof t==\"string\"},isObject:function(t){return typeof t==\"object\"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};Z.parse=Li,Z.resolve=function(t,e){return Li(t,!1,!0).resolve(e)},Z.resolveObject=function(t,e){return t?Li(t,!1,!0).resolveObject(e):e},Z.format=function(t){return gt.isString(t)&&(t=Li(t)),t instanceof Fe?t.format():Fe.prototype.format.call(t)},Z.Url=Fe;dE=/^([a-z0-9.+-]+:)/i,pE=/:[0-9]*$/,gE=/^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,yE=[\"{\",\"}\",\"|\",\"\\\\\",\"^\",\"`\"].concat([\"<\",\">\",'\"',\"`\",\" \",\"\\r\",`",
"`,\"\t\"]),il=[\"'\"].concat(yE),lg=[\"%\",\"/\",\"?\",\";\",\"#\"].concat(il),ug=[\"/\",\"?\",\"#\"],fg=/^[+a-z0-9A-Z_-]{0,63}$/,bE=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,wE={javascript:!0,\"javascript:\":!0},el={javascript:!0,\"javascript:\":!0},ai={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,\"http:\":!0,\"https:\":!0,\"ftp:\":!0,\"gopher:\":!0,\"file:\":!0},tl=pt;Fe.prototype.parse=function(t,e,r){if(!gt.isString(t))throw new TypeError(\"Parameter 'url' must be a string, not \"+typeof t);var i=t.indexOf(\"?\"),n=i!==-1&&i<t.indexOf(\"#\")?\"?\":\"#\",o=t.split(n);o[0]=o[0].replace(/\\\\/g,\"/\");var s=t=o.join(n);if(s=s.trim(),!r&&t.split(\"#\").length===1){var a=gE.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?tl.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search=\"\",this.query={}),this}var l=dE.exec(s);if(l){var c=(l=l[0]).toLowerCase();this.protocol=c,s=s.substr(l.length)}if(r||l||s.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)){var h=s.substr(0,2)===\"//\";!h||l&&el[l]||(s=s.substr(2),this.slashes=!0)}if(!el[l]&&(h||l&&!ai[l])){for(var d,g,y=-1,w=0;w<ug.length;w++)(S=s.indexOf(ug[w]))!==-1&&(y===-1||S<y)&&(y=S);for((g=y===-1?s.lastIndexOf(\"@\"):s.lastIndexOf(\"@\",y))!==-1&&(d=s.slice(0,g),s=s.slice(g+1),this.auth=decodeURIComponent(d)),y=-1,w=0;w<lg.length;w++){var S;(S=s.indexOf(lg[w]))!==-1&&(y===-1||S<y)&&(y=S)}y===-1&&(y=s.length),this.host=s.slice(0,y),s=s.slice(y),this.parseHost(),this.hostname=this.hostname||\"\";var E=this.hostname[0]===\"[\"&&this.hostname[this.hostname.length-1]===\"]\";if(!E)for(var I=this.hostname.split(/\\./),C=(w=0,I.length);w<C;w++){var R=I[w];if(R&&!R.match(fg)){for(var U=\"\",N=0,W=R.length;N<W;N++)R.charCodeAt(N)>127?U+=\"x\":U+=R[N];if(!U.match(fg)){var K=I.slice(0,w),z=I.slice(w+1),Q=R.match(bE);Q&&(K.push(Q[1]),z.unshift(Q[2])),z.length&&(s=\"/\"+z.join(\".\")+s),this.hostname=K.join(\".\");break}}}this.hostname.length>255?this.hostname=\"\":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=hE.toASCII(this.hostname));var pe=this.port?\":\"+this.port:\"\",Yt=this.hostname||\"\";this.host=Yt+pe,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!==\"/\"&&(s=\"/\"+s))}if(!wE[c])for(w=0,C=il.length;w<C;w++){var ge=il[w];if(s.indexOf(ge)!==-1){var Pr=encodeURIComponent(ge);Pr===ge&&(Pr=escape(ge)),s=s.split(ge).join(Pr)}}var kr=s.indexOf(\"#\");kr!==-1&&(this.hash=s.substr(kr),s=s.slice(0,kr));var Or=s.indexOf(\"?\");if(Or!==-1?(this.search=s.substr(Or),this.query=s.substr(Or+1),e&&(this.query=tl.parse(this.query)),s=s.slice(0,Or)):e&&(this.search=\"\",this.query={}),s&&(this.pathname=s),ai[c]&&this.hostname&&!this.pathname&&(this.pathname=\"/\"),this.pathname||this.search){pe=this.pathname||\"\";var hs=this.search||\"\";this.path=pe+hs}return this.href=this.format(),this},Fe.prototype.format=function(){var t=this.auth||\"\";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,\":\"),t+=\"@\");var e=this.protocol||\"\",r=this.pathname||\"\",i=this.hash||\"\",n=!1,o=\"\";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(\":\")===-1?this.hostname:\"[\"+this.hostname+\"]\"),this.port&&(n+=\":\"+this.port)),this.query&&gt.isObject(this.query)&&Object.keys(this.query).length&&(o=tl.stringify(this.query));var s=this.search||o&&\"?\"+o||\"\";return e&&e.substr(-1)!==\":\"&&(e+=\":\"),this.slashes||(!e||ai[e])&&n!==!1?(n=\"//\"+(n||\"\"),r&&r.charAt(0)!==\"/\"&&(r=\"/\"+r)):n||(n=\"\"),i&&i.charAt(0)!==\"#\"&&(i=\"#\"+i),s&&s.charAt(0)!==\"?\"&&(s=\"?\"+s),e+n+(r=r.replace(/[?#]/g,function(a){return encodeURIComponent(a)}))+(s=s.replace(\"#\",\"%23\"))+i},Fe.prototype.resolve=function(t){return this.resolveObject(Li(t,!1,!0)).format()},Fe.prototype.resolveObject=function(t){if(gt.isString(t)){var e=new Fe;e.parse(t,!1,!0),t=e}for(var r=new Fe,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,t.href===\"\")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var l=s[a];l!==\"protocol\"&&
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
"name": "onScenePostEvents",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"// Remove the messages of the last frame for no dataloss mode",
"Object",
" .values(gdjs.evtTools.mqtt.events)",
" .forEach((event, index) => {",
" if (Array.isArray(event.data))",
" event.data.shift();",
" else event.data = gdjs.evtTools.mqtt.empty;",
" });",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [],
"objectGroups": []
},
{
"description": "Triggers if the client is connected to an MQTT broker server.",
"fullName": "Is connected to a broker?",
"functionType": "Condition",
"name": "isConnected",
"sentence": "Client connected to a broker",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"eventsFunctionContext.returnValue =",
" gdjs.evtTools.mqtt.connection && gdjs.evtTools.mqtt.connection.connected;",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [],
"objectGroups": []
},
{
"description": "Connects to an MQTT broker. ",
"fullName": "Connect to a broker",
"functionType": "Action",
"name": "connect",
"sentence": "Connect to MQTT broker _PARAM1_ with parameters _PARAM2_ (secure connection: _PARAM3_)",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"// Parse settings",
"const settings = eventsFunctionContext.getArgument(\"settings\");",
"let settingsParsed;",
"if (settings.length > 2)",
" try {",
" settingsParsed = JSON.parse(settings);",
" } catch (e) {",
" settingsParsed = {}",
" console.error(\"Invalid settings: \", settings, \", Error:\", e);",
" };",
"",
"// Connect to broker",
"gdjs.evtTools.mqtt.connection = mqtt.connect(",
" (eventsFunctionContext.getArgument(\"secure\")",
" ? \"wss://\"",
" : \"ws://\")",
" + eventsFunctionContext.getArgument(\"host\"),",
" settingsParsed",
");",
"",
"// Set up listeners",
"gdjs.evtTools.mqtt.connection.on(\"message\", (channel, message) => {",
" if (typeof gdjs.evtTools.mqtt.events[channel] === undefined) {",
" gdjs.evtTools.mqtt.events[channel] = {",
" loss: false,",
" data: [message],",
" };",
" return;",
" }",
"",
" const mqttEvent = gdjs.evtTools.mqtt.events[channel];",
" if (mqttEvent.loss) {",
" mqttEvent.data = message;",
" } else {",
" if (!Array.isArray(mqttEvent.data)) mqttEvent.data = [];",
" mqttEvent.data.push(message);",
" }",
"});",
"",
"gdjs.evtTools.mqtt.connection.on(\"error\", function (e) {",
" gdjs.evtTools.mqtt.lastError = e;",
"});",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"parameters": [
{
"description": "Host port",
"name": "host",
"type": "string"
},
{
"description": "Settings as JSON",
"longDescription": "You can find the list of settings at [the MQTT.js docs](https://github.com/mqttjs/MQTT.js/#client). \nAn example of valid configuration would be `\"{\\\"clientId\\\": \\\"myUserName\\\"}\"`.",
"name": "settings",
"type": "string"
},
{
"description": "Use secure WebSockets?",
"name": "secure",
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Disconnects from the current MQTT broker.",
"fullName": "Disconnect from broker",
"functionType": "Action",
"name": "disconnect",
"sentence": "Disconnect from MQTT broker (force: _PARAM1_)",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"if (gdjs.evtTools.mqtt.connection === null) return;",
"gdjs.evtTools.mqtt.connection.end(eventsFunctionContext.getArgument(\"force\"));",
"gdjs.evtTools.mqtt.connection = null;",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Force end the connection?",
"longDescription": "By default, MQTT waits for pending messages or messages in the process of being sent to finish being sent before ending the connection. Use this to cancel any request and immediately shutdown the connection.",
"name": "force",
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Publishes a message on a topic.",
"fullName": "Publish message",
"functionType": "Action",
"name": "publish",
"sentence": "Publish variable _PARAM1_ on topic _PARAM2_ (QoS: _PARAM3_)",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"if (gdjs.evtTools.mqtt.connection === null) return;",
"gdjs.evtTools.mqtt.connection.publish(",
" eventsFunctionContext.getArgument(\"topic\"),",
" eventsFunctionContext.getArgument(\"content\"),",
" { qos: eventsFunctionContext.getArgument(\"QoS\"), retain: eventsFunctionContext.getArgument(\"retain\") }",
");",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Text to publish",
"name": "content",
"type": "string"
},
{
"description": "Topic to publish to",
"name": "topic",
"type": "string"
},
{
"description": "The QoS",
"longDescription": "See [this](https://github.com/mqttjs/MQTT.js#qos) for more details.",
"name": "QoS",
"type": "expression"
},
{
"description": "Should the message be retained?",
"longDescription": "When a message is retained, it will be sent to every client that subscribe to the topic. Only one message can be retained per topic, if another retained message is sent it will overwrite the previous one. \nRead more [here](https://www.hivemq.com/blog/mqtt-essentials-part-8-retained-messages/#retained-messages).",
"name": "retain",
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Subcribe to a topic. All messages published on that topic will be received.",
"fullName": "Subscribe to a topic",
"functionType": "Action",
"name": "subscribe",
"sentence": "Subscribe to topic _PARAM1_ with QoS at _PARAM2_ and dataloss _PARAM3_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"if (gdjs.evtTools.mqtt.connection === null) return;",
"",
"const topic = eventsFunctionContext.getArgument(\"topic\");",
"if (typeof gdjs.evtTools.mqtt.events[topic] === \"undefined\") gdjs.evtTools.mqtt.events[topic] = { data: eventsFunctionContext.getArgument(\"dataloss\") ? \"\" : [] };",
"gdjs.evtTools.mqtt.events[topic].loss = eventsFunctionContext.getArgument(\"dataloss\");",
"",
"gdjs.evtTools.mqtt.connection.subscribe(",
" topic,",
" { qos: eventsFunctionContext.getArgument(\"QoS\") }",
");",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The topic to subscribe to",
"name": "topic",
"type": "string"
},
{
"description": "The QoS",
"longDescription": "See https://github.com/mqttjs/MQTT.js#qos for more details",
"name": "QoS",
"type": "expression"
},
{
"description": "Is dataloss allowed?",
"longDescription": "See https://wiki.gdevelop.io/gdevelop5/all-features/p2p#choosing_if_you_want_to_activate_data_loss_mode for more details",
"name": "dataloss",
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Unsubcribe from a topic. No more messages from this topic will be received.",
"fullName": "Unsubscribe from a topic",
"functionType": "Action",
"name": "unsubscribe",
"sentence": "Unsubscribe from topic _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"if (gdjs.evtTools.mqtt.connection !== null)",
" gdjs.evtTools.mqtt.connection.unsubscribe(",
" eventsFunctionContext.getArgument(\"topic\")",
" );",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The topic to subscribe to",
"name": "topic",
"type": "string"
}
],
"objectGroups": []
},
{
"description": "Triggers whenever a message was received. Note that you first need to subcribe to a topic in order to get messages from it.",
"fullName": "On message",
"functionType": "Condition",
"name": "onMessage",
"sentence": "Message received from topic _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const mqttEvent = gdjs.evtTools.mqtt.events[eventsFunctionContext.getArgument(\"topic\")];\r",
"if (typeof mqttEvent === \"undefined\" || typeof mqttEvent.data === \"undefined\") return;\r",
"eventsFunctionContext.returnValue =\r",
" Array.isArray(mqttEvent.data)\r",
" ? mqttEvent.data.length !== 0\r",
" : mqttEvent.data !== gdjs.evtTools.mqtt.empty;\r",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The topic to listen to",
"name": "topic",
"type": "string"
}
],
"objectGroups": []
},
{
"description": "Get the last received message of a topic.",
"fullName": "Get last message",
"functionType": "StringExpression",
"name": "GetLastMessage",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const mqttEvent = gdjs.evtTools.mqtt.events[eventsFunctionContext.getArgument(\"topic\")];",
"if (typeof mqttEvent === \"undefined\") return;",
"eventsFunctionContext.returnValue = Array.isArray(mqttEvent.data)",
" ? mqttEvent.data[0]",
" : mqttEvent.data;",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"expressionType": {
"type": "string"
},
"parameters": [
{
"description": "The topic to get the message from",
"name": "topic",
"type": "string"
}
],
"objectGroups": []
},
{
"description": "Gets the last error. Returns an empty string if there was no errors.",
"fullName": "Get the last error",
"functionType": "StringExpression",
"name": "getCurrentError",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": "eventsFunctionContext.returnValue = gdjs.evtTools.mqtt.lastError",
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"expressionType": {
"type": "string"
},
"parameters": [],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "onFirstSceneLoaded"
},
{
"functionName": "onScenePostEvents"
},
{
"functionName": "isConnected"
},
{
"functionName": "connect"
},
{
"functionName": "disconnect"
},
{
"functionName": "publish"
},
{
"functionName": "subscribe"
},
{
"functionName": "unsubscribe"
},
{
"functionName": "onMessage"
},
{
"functionName": "GetLastMessage"
},
{
"functionName": "getCurrentError"
}
]
},
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
},
{
"author": "",
"category": "Network",
"dimension": "",
"extensionNamespace": "",
"fullName": "Advanced HTTP",
"gdevelopVersion": ">=5.5.222",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjEwO30NCjwvc3R5bGU+DQo8cG9seWxpbmUgY2xhc3M9InN0MCIgcG9pbnRzPSIxMSwxMiAyMSwxOCAzMSwxMiAiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSI0IiB5MT0iMTIiIHgyPSIxMSIgeTI9IjEyIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMSIgeTE9IjE2IiB4Mj0iMTIiIHkyPSIxNiIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjQiIHkxPSIyMCIgeDI9IjExIiB5Mj0iMjAiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMSwxMnYtMWMwLTIuMiwxLjgtNCw0LTRoMTJjMi4yLDAsNCwxLjgsNCw0djEwYzAsMi4yLTEuOCw0LTQsNEgxNWMtMi4yLDAtNC0xLjgtNC00di0xIi8+DQo8L3N2Zz4NCg==",
"name": "AdvancedHTTP",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Line Hero Pack/Master/SVG/Email/04e28ac117741933d15ac1cadb34e0d799c7a561352b1525a1b75c5bd1dbeabc_Email_email_envelope_letter_message_fast.svg",
"shortDescription": "HTTP requests with custom headers, methods, caching, CORS bypass, and JSON/FormData body.",
"version": "1.1.0",
"description": "An extension to create HTTP requests with more advanced settings than the built-in \"Network request\" action, like specifying headers or bypassing CORS.",
"origin": {
"identifier": "AdvancedHTTP",
"name": "gdevelop-extension-store"
},
"tags": [
"header",
"beacon",
"http",
"request",
"get",
"post",
"delete",
"patch",
"head",
"method",
"body",
"html",
"request",
"web",
"curl",
"url"
],
"authorIds": [
"ZgrsWuRTAkXgeuPV9bo0zuEcA2w1"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Creates a template for your request. All requests must be made from a request template.",
"fullName": "Create a new request template",
"functionType": "Action",
"group": "Request creation",
"name": "CreateRequest",
"sentence": "Create request template _PARAM1_ with URL _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "GlobalVariableClearChildren"
},
"parameters": [
"__AdvancedHTTP.Requests[Request]"
]
},
{
"type": {
"value": "ModVarGlobalTxt"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].URL",
"=",
"URL"
]
}
]
}
],
"parameters": [
{
"description": "New request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "URL the request will be sent to",
"name": "URL",
"supplementaryInformation": "sceneURL",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "Creates a new request template with all the attributes from an existing one.",
"fullName": "Copy a request template",
"functionType": "Action",
"group": "Request creation",
"name": "CopyRequest",
"sentence": "Create request _PARAM1_ from template _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "JSONToGlobalVariableStructure"
},
"parameters": [
"GlobalVarToJSON(__AdvancedHTTP.Requests[OriginRequest])",
"__AdvancedHTTP.Requests[Request]"
]
}
]
}
],
"parameters": [
{
"description": "New request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "Request to copy",
"name": "OriginRequest",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "The HTTP method of the request. GET is the default and what you should use if you are unsure which to pick. A request to a REST API endpoint may have a different effect depending on the method - refer to the documentation of the API you are calling to learn about the appropriate method to use.",
"fullName": "HTTP Method (Verb)",
"functionType": "Action",
"group": "Request settings",
"name": "SetRequestMethod",
"sentence": "Set HTTP method of request _PARAM1_ to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "ModVarGlobalTxt"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options.method",
"=",
"Method"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "HTTP Method",
"name": "Method",
"supplementaryInformation": "[\"GET\",\"POST\",\"PUT\",\"PATCH\",\"DELETE\",\"HEAD\",\"TRACE\",\"CONNECT\",\"OPTIONS\"]",
"type": "stringWithSelector"
}
],
"objectGroups": []
},
{
"description": "the HTTP method of the request. GET is the default and what you should use if you are unsure which to pick. A request to a REST API endpoint may have a different effect depending on the method - refer to the documentation of the API you are calling to learn about the appropriate method to use.",
"fullName": "HTTP Method (Verb)",
"functionType": "ExpressionAndCondition",
"group": "Request settings",
"name": "RequestMethod",
"sentence": "HTTP method of request _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options",
"\"method\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"GlobalVariableString(__AdvancedHTTP.Requests[Request].Options.method)"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options",
"\"method\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"\"GET\""
]
}
]
}
],
"expressionType": {
"supplementaryInformation": "[\"GET\",\"HEAD\",\"POST\",\"PUT\",\"OPTIONS\",\"CONNECT\",\"TRACE\"]",
"type": "stringWithSelector"
},
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "Defines to what extent the results of the request is can/must be cached. When cached, instead of sending a request to the server, the browser will avoid making a real request to the server and will use a previous response given by the server for the same request.\n\nThe server also has a say in this via the Cache-Control header.",
"fullName": "HTTP Caching strategy",
"functionType": "Action",
"group": "Request settings",
"name": "SetRequestCache",
"sentence": "Set HTTP caching strategy of request _PARAM1_ to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "ModVarGlobalTxt"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options.cache",
"=",
"Cache"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "HTTP Caching strategy",
"longDescription": "Learn more about what each caching strategy does [on the MDN page for cache](https://developer.mozilla.org/en-US/docs/Web/API/Request/cache).",
"name": "Cache",
"supplementaryInformation": "[\"default\",\"no-store\",\"reload\",\"no-cache\",\"force-cache\",\"only-if-cached\"]",
"type": "stringWithSelector"
}
],
"objectGroups": []
},
{
"description": "the HTTP method of the request. GET is the default and what you should use if you are unsure which to pick. A request to a REST API endpoint may have a different effect depending on the method - refer to the documentation of the API you are calling to learn about the appropriate method to use.",
"fullName": "HTTP Caching",
"functionType": "ExpressionAndCondition",
"group": "Request settings",
"name": "RequestCache",
"sentence": "HTTP caching strategy of request _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options",
"\"cache\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"GlobalVariableString(__AdvancedHTTP.Requests[Request].Options.cache)"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options",
"\"cache\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"\"default\""
]
}
]
}
],
"expressionType": {
"supplementaryInformation": "[\"default\",\"reload\",\"no-cache\",\"force-cache\",\"only-if-cached\"]",
"type": "stringWithSelector"
},
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "The HTTP method of the request. GET is the default and what you should use if you are unsure which to pick. A request to a REST API endpoint may have a different effect depending on the method - refer to the documentation of the API you are calling to learn about the appropriate method to use.",
"fullName": "HTTP Method (Verb)",
"functionType": "ActionWithOperator",
"getterName": "RequestBody",
"group": "Request settings",
"name": "SetRequestBody",
"sentence": "Set HTTP method of request _PARAM1_ to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "ModVarGlobalTxt"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options.body",
"=",
"Value"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "HTTP Method",
"name": "Method",
"supplementaryInformation": "[\"GET\",\"POST\",\"PUT\",\"PATCH\",\"DELETE\",\"HEAD\",\"TRACE\",\"CONNECT\",\"OPTIONS\"]",
"type": "stringWithSelector"
}
],
"objectGroups": []
},
{
"description": "Sets the body of an HTTP request to a JSON representation of a structure variable.",
"fullName": "Body as JSON",
"functionType": "Action",
"getterName": "RequestBody",
"group": "Request settings",
"name": "SetJSONRequestBody",
"sentence": "Set body of request _PARAM1_ to contents of _PARAM2_ as JSON",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "CopyArgumentToVariable"
},
"parameters": [
"\"Body\"",
"__AdvancedHTTP.Body"
]
},
{
"type": {
"value": "ModVarGlobalTxt"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options.body",
"=",
"ToJSON(__AdvancedHTTP.Body)"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "Variable with body contents",
"name": "Body",
"supplementaryInformation": "[\"GET\",\"POST\",\"PUT\",\"PATCH\",\"DELETE\",\"HEAD\",\"TRACE\",\"CONNECT\",\"OPTIONS\"]",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "Sets the body of an HTTP request to a form data representation of a structure variable.",
"fullName": "Body as form data",
"functionType": "Action",
"getterName": "RequestBody",
"group": "Request settings",
"name": "SetFormDataRequestBody",
"sentence": "Set body of request _PARAM1_ to contents of _PARAM2_ as form data",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Merge form data with the form data of the request"
},
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"gdjs.Variable.copy(",
" eventsFunctionContext.getArgument(\"Body\"),",
" runtimeScene.getGame().getVariables().get(\"__AdvancedHTTP\")",
" .getChild(\"Requests\")",
" .getChild(eventsFunctionContext.getArgument(\"Request\"))",
" .getChild(\"FormData\"),",
" /* mergeVariables = */true",
");",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "Variable with body contents",
"name": "Body",
"supplementaryInformation": "[\"GET\",\"POST\",\"PUT\",\"PATCH\",\"DELETE\",\"HEAD\",\"TRACE\",\"CONNECT\",\"OPTIONS\"]",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "the body of the HTTP request. Contains data to send to the server, ususally in plain text, JSON or FormData format. This cannot be set for GET requests.",
"fullName": "Body",
"functionType": "ExpressionAndCondition",
"group": "Request settings",
"name": "RequestBody",
"sentence": "body of request _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options",
"\"body\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"GlobalVariableString(__AdvancedHTTP.Requests[Request].Options.body)"
]
}
]
}
],
"expressionType": {
"supplementaryInformation": "[\"GET\",\"HEAD\",\"POST\",\"PUT\",\"OPTIONS\",\"CONNECT\",\"TRACE\"]",
"type": "string"
},
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "The HTTP method of the request. GET is the default and what you should use if you are unsure which to pick. A request to a REST API endpoint may have a different effect depending on the method - refer to the documentation of the API you are calling to learn about the appropriate method to use.",
"fullName": "HTTP Method (Verb)",
"functionType": "ActionWithOperator",
"getterName": "RequestHeader",
"group": "Request settings",
"name": "SetRequestHeader",
"sentence": "Set HTTP method of request _PARAM1_ to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "ModVarGlobalTxt"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options.headers[Header]",
"=",
"Value"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "HTTP Method",
"name": "Method",
"supplementaryInformation": "[\"GET\",\"POST\",\"PUT\",\"PATCH\",\"DELETE\",\"HEAD\",\"TRACE\",\"CONNECT\",\"OPTIONS\"]",
"type": "stringWithSelector"
}
],
"objectGroups": []
},
{
"description": "an HTTP header to be sent with the request.",
"fullName": "Header",
"functionType": "ExpressionAndCondition",
"group": "Request settings",
"name": "RequestHeader",
"sentence": "HTTP header _PARAM2_ of request _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options",
"\"headers\""
]
},
{
"type": {
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].Options.headers",
"Header"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"GlobalVariableString(__AdvancedHTTP.Requests[Request].Options.headers[Header])"
]
}
]
}
],
"expressionType": {
"supplementaryInformation": "sceneHeader",
"type": "string"
},
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "HTTP header name",
"name": "Header",
"supplementaryInformation": "sceneHeader",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "The HTTP method of the request. GET is the default and what you should use if you are unsure which to pick. A request to a REST API endpoint may have a different effect depending on the method - refer to the documentation of the API you are calling to learn about the appropriate method to use.",
"fullName": "HTTP Method (Verb)",
"functionType": "ActionWithOperator",
"getterName": "RequestURL",
"group": "Request settings",
"name": "SetRequestURL",
"sentence": "Set HTTP method of request _PARAM1_ to _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "ModVarGlobalTxt"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].URL",
"=",
"Value"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "the request template's target URL.",
"fullName": "URL",
"functionType": "ExpressionAndCondition",
"group": "Request settings",
"name": "RequestURL",
"sentence": "the URL of request template _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"GlobalVariableString(__AdvancedHTTP.Requests[Request].URL)"
]
}
]
}
],
"expressionType": {
"supplementaryInformation": "sceneURL",
"type": "identifier"
},
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
}
],
"objectGroups": []
},
{
"description": "CORS prevents most external websites from being queried with the browser's HTTP client, since the browser may be authenticated on that website and as such another website would be able to impersonate the player on that other website.\n\nWhen the CORS Bypass is enabled, the request will be made from a server that is not authenticated anywhere and as such is not blocked by CORS, and it will share the response with your game. Note that as such, authentication cookies are ignored! If you own the REST API you are requesting, add CORS headers to your server instead of using this CORS Bypass.",
"fullName": "Enable CORS Bypass",
"functionType": "Action",
"group": "Request settings",
"name": "UseCORSBypass",
"sentence": "Enable CORS Bypass for request _PARAM1_: _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"UseBypass",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "SetGlobalVariableAsBoolean"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].CORS",
"True"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "BooleanVariable"
},
"parameters": [
"UseBypass",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "SetGlobalVariableAsBoolean"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].CORS",
"False"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"defaultValue": "yes",
"description": "Enable the CORS Bypass?",
"longDescription": "The CORS Bypass server is offered for free by [arthuro555](https://twitter.com/arthuro555). Consider making a [donation](https://ko-fi.com/arthuro555) to help keep the CORS Bypass server running.",
"name": "UseBypass",
"optional": true,
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Checks whether or not CORS Bypass has been enabled for the request template.",
"fullName": "CORS Bypass enabled",
"functionType": "Condition",
"group": "Request settings",
"name": "IsUsingCORSBypass",
"sentence": "CORS Bypass is enabled for request _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "GlobalVariableAsBoolean"
},
"parameters": [
"__AdvancedHTTP.Requests[Request].CORS",
"True"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Request template name",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
}
],
"objectGroups": []
},
{
"async": true,
"description": "Executes the request defined by a request template.",
"fullName": "Execute the request",
"functionType": "Action",
"group": "Request execution",
"name": "ExecuteRequest",
"sentence": "Execute request _PARAM1_ and store results in _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const logger = (this.logger || (this.logger = new gdjs.Logger(\"Advanced HTTP\")));",
"const advancedHTTP = (gdjs._advancedHTTP || (gdjs._advancedHTTP = { responses: new Map(), id: 1 }));",
"",
"/** @type {gdjs.Variable} */",
"const result = eventsFunctionContext.getArgument(\"Response\");",
"const requestName = eventsFunctionContext.getArgument(\"Request\");",
"const request = runtimeScene",
" .getGame()",
" .getVariables()",
" .get(\"__AdvancedHTTP\")",
" .getChild(\"Requests\")",
" .getChild(requestName)",
" .toJSObject();",
"if (!request.Options) request.Options = {}",
"if (request.Options.method === 'GET' || request.Options.method === 'HEAD') delete request.Options.body;",
"",
"if (typeof request.URL !== \"string\") {",
" eventsFunctionContext.task.resolve();",
" logger.error(`Couldn't execute request '${requestName}' - has it been properly initialized?`);",
" return;",
"}",
"",
"function isContentful(obj) {",
" for (var x in obj) { return true; }",
" return false;",
"}",
"const hasFormData = request.FormData && isContentful(request.FormData)",
"console.log(isContentful(request.FormData), request.FormData)",
"",
"if (hasFormData) {",
" if (request.Options.body && request.Options.body !== \"\") {",
" console.warn(`The request ${requestName} has both form data and a separate body - the body will be ignored and replaced by the form data.`);",
" }",
"",
" delete request.Options.body;",
"}",
"",
"if (request.CORS) {",
" // Cache makes sense only on the client. CF Workers does not support cache property on fetch anyways.",
" const cache = request.Options.cache;",
" delete request.Options.cache;",
" eventsFunctionContext.task = new gdjs.PromiseTask(",
" fetch(`https://cors.arthuro555.com?${JSON.stringify({",
" url: request.URL,",
" options: request.Options,",
" formData: isContentful(request.FormData) ? request.FormData : undefined",
" })}`, { keepalive: true, cache })",
" .then(async (response) => {",
" const { ok, status, headers, body } = await response.json();",
" result.fromJSObject({",
" ok,",
" status,",
" headers,",
" body,",
" });",
" })",
" .catch((e) => {",
" logger.error(`Couldn't execute request '${requestName}': ${e}`);",
" })",
" );",
"} else {",
" if (hasFormData && request.Options.method !== 'GET' && request.Options.method !== 'HEAD') {",
" const fd = request.Options.body = new FormData();",
" for (const key of Object.keys(request.FormData)) {",
" fd.append(key, request.FormData[key])",
" }",
" }",
"",
" eventsFunctionContext.task = new gdjs.PromiseTask(",
" fetch(request.URL, { keepalive: true, ...request.Options })",
" .then((response) => {",
" const id = advancedHTTP.id++;",
" const { ok, status, headers } = response;",
" result.fromJSObject({",
" id,",
" ok,",
" status,",
" headers: Object.fromEntries(headers.entries()),",
" });",
" result.getChild(\"id\").setNumber(id);",
" advancedHTTP.responses.set(id, response);",
" setTimeout(() => advancedHTTP.responses.delete(id), 10_000);",
" })",
" .catch((e) => {",
" logger.error(`Couldn't execute request '${requestName}': ${e}`);",
" })",
" );",
"}"
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Request to execute",
"name": "Request",
"supplementaryInformation": "sceneRequest",
"type": "identifier"
},
{
"description": "Variable where to store the response to the request",
"name": "Response",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "Checks whether the server marked the response as a success (status code 1XX/2XX), not as a failure (status code 4XX/5XX).",
"fullName": "Success",
"functionType": "Condition",
"group": "Response",
"name": "ResponseSuccess",
"sentence": "Response _PARAM1_ indicates a success",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "CopyArgumentToVariable"
},
"parameters": [
"\"Response\"",
"__AdvancedHTTP.Response"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "SceneVariableAsBoolean"
},
"parameters": [
"__AdvancedHTTP.Response.ok",
"True"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Variable containing the response",
"name": "Response",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "the status code of the HTTP request (e.g. 200 if succeeded, 404 if not found, etc).",
"fullName": "Status code",
"functionType": "ExpressionAndCondition",
"group": "Response",
"name": "ResponseStatusCode",
"sentence": "Status code of response _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "CopyArgumentToVariable"
},
"parameters": [
"\"Response\"",
"__AdvancedHTTP.Response"
]
},
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"Variable(__AdvancedHTTP.Response.status)"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "Variable containing the response",
"name": "Response",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "Gets the status text for a response. For example, for a response with the status code 404, the status text will be \"Not Found\".",
"fullName": "Status text",
"functionType": "StringExpression",
"group": "Response",
"name": "ResponseStatusText",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "GlobalVariableChildExists"
},
"parameters": [
"__AdvancedHTTP",
"\"StatusTexts\""
]
}
],
"actions": [
{
"type": {
"value": "JSONToGlobalVariableStructure"
},
"parameters": [
"\"{\\\"100\\\":\\\"Continue\\\",\\\"101\\\":\\\"Switching Protocols\\\",\\\"102\\\":\\\"Processing\\\",\\\"200\\\":\\\"OK\\\",\\\"201\\\":\\\"Created\\\",\\\"202\\\":\\\"Accepted\\\",\\\"203\\\":\\\"Non-Authoritative Information\\\",\\\"204\\\":\\\"No Content\\\",\\\"205\\\":\\\"Reset Content\\\",\\\"206\\\":\\\"Partial Content\\\",\\\"207\\\":\\\"Multi-Status\\\",\\\"226\\\":\\\"IM Used\\\",\\\"300\\\":\\\"Multiple Choices\\\",\\\"301\\\":\\\"Moved Permanently\\\",\\\"302\\\":\\\"Found\\\",\\\"303\\\":\\\"See Other\\\",\\\"304\\\":\\\"Not Modified\\\",\\\"305\\\":\\\"Use Proxy\\\",\\\"307\\\":\\\"Temporary Redirect\\\",\\\"308\\\":\\\"Permanent Redirect\\\",\\\"400\\\":\\\"Bad Request\\\",\\\"401\\\":\\\"Unauthorized\\\",\\\"402\\\":\\\"Payment Required\\\",\\\"403\\\":\\\"Forbidden\\\",\\\"404\\\":\\\"Not Found\\\",\\\"405\\\":\\\"Method Not Allowed\\\",\\\"406\\\":\\\"Not Acceptable\\\",\\\"407\\\":\\\"Proxy Authentication Required\\\",\\\"408\\\":\\\"Request Timeout\\\",\\\"409\\\":\\\"Conflict\\\",\\\"410\\\":\\\"Gone\\\",\\\"411\\\":\\\"Length Required\\\",\\\"412\\\":\\\"Precondition Failed\\\",\\\"413\\\":\\\"Payload Too Large\\\",\\\"414\\\":\\\"URI Too Long\\\",\\\"415\\\":\\\"Unsupported Media Type\\\",\\\"416\\\":\\\"Range Not Satisfiable\\\",\\\"417\\\":\\\"Expectation Failed\\\",\\\"418\\\":\\\"I'm a teapot\\\",\\\"422\\\":\\\"Unprocessable Entity\\\",\\\"423\\\":\\\"Locked\\\",\\\"424\\\":\\\"Failed Dependency\\\",\\\"426\\\":\\\"Upgrade Required\\\",\\\"428\\\":\\\"Precondition Required\\\",\\\"429\\\":\\\"Too Many Requests\\\",\\\"431\\\":\\\"Request Header Fields Too Large\\\",\\\"451\\\":\\\"Unavailable For Legal Reasons\\\",\\\"500\\\":\\\"Internal Server Error\\\",\\\"501\\\":\\\"Not Implemented\\\",\\\"502\\\":\\\"Bad Gateway\\\",\\\"503\\\":\\\"Service Unavailable\\\",\\\"504\\\":\\\"Gateway Time-out\\\",\\\"505\\\":\\\"HTTP Version Not Supported\\\",\\\"506\\\":\\\"Variant Also Negotiates\\\",\\\"507\\\":\\\"Insufficient Storage\\\",\\\"511\\\":\\\"Network Authentication Required\\\",\\\"1xx\\\":\\\"**Informational**\\\",\\\"2xx\\\":\\\"**Successful**\\\",\\\"3xx\\\":\\\"**Redirection**\\\",\\\"4xx\\\":\\\"**Client Error**\\\",\\\"5xx\\\":\\\"**Server Error**\\\",\\\"7xx\\\":\\\"**Developer Error**\\\"}\"",
"__AdvancedHTTP.StatusTexts"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "CopyArgumentToVariable"
},
"parameters": [
"\"Response\"",
"__AdvancedHTTP.Response"
]
},
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"GlobalVariableString(__AdvancedHTTP.StatusTexts[Variable(__AdvancedHTTP.Response.status)])"
]
}
]
}
],
"expressionType": {
"type": "string"
},
"parameters": [
{
"description": "Variable containing the response",
"name": "Response",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "one of the HTTP headers included in the server's response.",
"fullName": "Header",
"functionType": "ExpressionAndCondition",
"group": "Response",
"name": "ResponseHeader",
"sentence": "Header _PARAM2_ of response _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "CopyArgumentToVariable"
},
"parameters": [
"\"Response\"",
"__AdvancedHTTP.Response"
]
},
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"VariableString(__AdvancedHTTP.Response.headers[Header])"
]
}
]
}
],
"expressionType": {
"type": "string"
},
"parameters": [
{
"description": "Variable containing the response",
"name": "Response",
"type": "scenevar"
},
{
"description": "Header",
"name": "Header",
"supplementaryInformation": "sceneHeader",
"type": "identifier"
}
],
"objectGroups": []
},
{
"async": true,
"description": "Reads the body sent by the server, and store it as a string in a variable.",
"fullName": "Get response body (text)",
"functionType": "Action",
"group": "Response",
"name": "ReadResponseText",
"sentence": "Read body of response _PARAM1_ into _PARAM2_ as text",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const logger = (this.logger || (this.logger = new gdjs.Logger(\"Advanced HTTP\")));\r",
"const advancedHTTP = (gdjs._advancedHTTP || (gdjs._advancedHTTP = { responses: new Map(), id: 1 }));\r",
"\r",
"/** @type {gdjs.Variable} */\r",
"const response = eventsFunctionContext.getArgument(\"Response\");\r",
"/** @type {gdjs.Variable} */\r",
"const body = eventsFunctionContext.getArgument(\"Body\");\r",
"\r",
"const id = response.getChild(\"id\").getAsNumber();\r",
"const responseBody = response.getChild(\"body\").getAsString();\r",
"\r",
"if (responseBody !== \"0\") {\r",
" body.setString(responseBody);\r",
" eventsFunctionContext.task.resolve();\r",
" return;\r",
"}\r",
"\r",
"if (!advancedHTTP.responses.has(id)) {\r",
" eventsFunctionContext.task.resolve();\r",
" logger.error(`Couldn't read the body of a request. Either an invalid request has passed, or the body has already been disposed of. The body must be read within 10 seconds of the request succeeding, as it will then be disposed of.`);\r",
" return;\r",
"}\r",
"\r",
"const fetchResponse = advancedHTTP.responses.get(id);\r",
"\r",
"eventsFunctionContext.task = new gdjs.PromiseTask(\r",
" fetchResponse\r",
" .text()\r",
" .then((text) => {\r",
" body.setString(text);\r",
" })\r",
" .catch((e) => {\r",
" logger.error(`An error occured while reading the body of a request: ${e}`)\r",
" })\r",
")\r",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Variable containing the response",
"name": "Response",
"type": "scenevar"
},
{
"description": "Variable where to write the body contents into",
"name": "Body",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"async": true,
"description": "Reads the body sent by the server, parses it as JSON and stores the resulting structure in a variable.",
"fullName": "Get response body (JSON)",
"functionType": "Action",
"group": "Response",
"name": "ReadResponseJSON",
"sentence": "Read body of response _PARAM1_ into _PARAM2_ as JSON",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const logger = (this.logger || (this.logger = new gdjs.Logger(\"Advanced HTTP\")));\r",
"const advancedHTTP = (gdjs._advancedHTTP || (gdjs._advancedHTTP = { responses: new Map(), id: 1 }));\r",
"\r",
"/** @type {gdjs.Variable} */\r",
"const response = eventsFunctionContext.getArgument(\"Response\");\r",
"/** @type {gdjs.Variable} */\r",
"const body = eventsFunctionContext.getArgument(\"Body\");\r",
"\r",
"const id = response.getChild(\"id\").getAsNumber();\r",
"const responseBody = response.getChild(\"body\").getAsString();\r",
"\r",
"if (responseBody !== \"0\") {\r",
" try {\r",
" const parsedBody = JSON.parse(responseBody)\r",
" body.fromJSObject(parsedBody);\r",
" } catch (e) {\r",
" logger.error(`An error occured while reading the body of a request: ${e}`)\r",
" }\r",
" eventsFunctionContext.task.resolve();\r",
" return;\r",
"}\r",
"\r",
"if (!advancedHTTP.responses.has(id)) {\r",
" eventsFunctionContext.task.resolve();\r",
" logger.error(`Couldn't read the body of a request. Either an invalid request has passed, or the body has already been disposed of. The body must be read within 10 seconds of the request succeeding, as it will then be disposed of.`);\r",
" return;\r",
"}\r",
"\r",
"const fetchResponse = advancedHTTP.responses.get(id);\r",
"\r",
"eventsFunctionContext.task = new gdjs.PromiseTask(\r",
" fetchResponse\r",
" .json()\r",
" .then((json) => {\r",
" body.fromJSObject(json);\r",
" })\r",
" .catch((e) => {\r",
" logger.error(`An error occured while reading the body of a request: ${e}`)\r",
" })\r",
")\r",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "Variable containing the response",
"name": "Response",
"type": "scenevar"
},
{
"description": "Variable where to write the body contents into",
"name": "Body",
"type": "scenevar"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"folderName": "Request creation",
"children": [
{
"functionName": "CreateRequest"
},
{
"functionName": "CopyRequest"
}
]
},
{
"folderName": "Request settings",
"children": [
{
"functionName": "SetRequestMethod"
},
{
"functionName": "RequestMethod"
},
{
"functionName": "SetRequestCache"
},
{
"functionName": "RequestCache"
},
{
"functionName": "SetRequestBody"
},
{
"functionName": "SetJSONRequestBody"
},
{
"functionName": "SetFormDataRequestBody"
},
{
"functionName": "RequestBody"
},
{
"functionName": "SetRequestHeader"
},
{
"functionName": "RequestHeader"
},
{
"functionName": "SetRequestURL"
},
{
"functionName": "RequestURL"
},
{
"functionName": "UseCORSBypass"
},
{
"functionName": "IsUsingCORSBypass"
}
]
},
{
"folderName": "Request execution",
"children": [
{
"functionName": "ExecuteRequest"
}
]
},
{
"folderName": "Response",
"children": [
{
"functionName": "ResponseSuccess"
},
{
"functionName": "ResponseStatusCode"
},
{
"functionName": "ResponseStatusText"
},
{
"functionName": "ResponseHeader"
},
{
"functionName": "ReadResponseText"
},
{
"functionName": "ReadResponseJSON"
}
]
}
]
},
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
},
{
"author": "",
"category": "Movement",
"dimension": "2D",
"extensionNamespace": "",
"fullName": "Pixel perfect movement",
"gdevelopVersion": ">=5.5.222",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQoJLnN0MXtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO30NCgkuc3Qye2ZpbGw6bm9uZTtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MjtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLWRhc2hhcnJheTo2LDY7fQ0KCS5zdDN7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtZGFzaGFycmF5OjQsNDt9DQoJLnN0NHtmaWxsOm5vbmU7c3Ryb2tlOiMwMDAwMDA7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7fQ0KCS5zdDV7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1kYXNoYXJyYXk6My4xMDgxLDMuMTA4MTt9DQoJDQoJCS5zdDZ7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDtzdHJva2UtZGFzaGFycmF5OjQsMzt9DQo8L3N0eWxlPg0KPHJlY3QgeD0iNCIgeT0iNCIgY2xhc3M9InN0MCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMTIiIHkxPSIyOCIgeDI9IjEyIiB5Mj0iNCIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIwIiB5MT0iMjgiIHgyPSIyMCIgeTI9IjQiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIyOCIgeTE9IjIwIiB4Mj0iNCIgeTI9IjIwIi8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjgiIHkxPSIxMiIgeDI9IjQiIHkyPSIxMiIvPg0KPC9zdmc+DQo=",
"name": "PixelPerfectMovement",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Graphic Design/Graphic Design_grid.svg",
"shortDescription": "Grid-based pixel-perfect movement for platformer and top-down characters.",
"version": "0.3.2",
"description": [
"Games with pixel art usually use pixels bigger than actual pixels of the screen. This can lead to big pixels partially overlapping each other which doesn't look good.",
"",
"This extension allows to seamlessly keep big pixels aligned when the object is stopped and still beneficiate from the high resolution of the screen to have smooth movements.",
"",
"It can be used for:",
"* Pixel-perfect platformers ([open the project online](https://editor.gdevelop.io/?project=example://platformer-with-tilemap))",
"* Align top-down characters on a grid ([open the project online](https://editor.gdevelop.io/?project=example://top-down-grid-movement))"
],
"origin": {
"identifier": "PixelPerfectMovement",
"name": "gdevelop-extension-store"
},
"tags": [
"pixel perfect",
"platformer",
"platform",
"top-down",
"movement",
"grid"
],
"authorIds": [
"IWykYNRvhCZBN3vEgKEbBPOR3Oc2",
"mkJFlZEo4aXeAZxt8CsXjEkW4Oq1",
"mMR36hCjO5dlcYmhNSuVtcREM473"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Return the speed necessary to cover a distance according to the deceleration.",
"fullName": "Speed to reach",
"functionType": "Expression",
"name": "SpeedToReach",
"private": true,
"sentence": "Braking distance from an initial speed: _PARAM2_ and a deceleration: _PARAM3_ is less than _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"Distance",
">=",
"0"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"sqrt(2 * Distance * Deceleration)"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"Distance",
"<",
"0"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"-sqrt(-2 * Distance * Deceleration)"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "Distance",
"name": "Distance",
"type": "expression"
},
{
"description": "Deceleration",
"name": "Deceleration",
"type": "expression"
}
],
"objectGroups": []
},
{
"description": "Return the braking distance according to an initial speed and a deceleration.",
"fullName": "Braking distance",
"functionType": "Expression",
"name": "BrakingDistance",
"private": true,
"sentence": "Braking distance from an initial speed: _PARAM2_ and a deceleration: _PARAM3_ is less than _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"Speed * Speed / (2 * Deceleration)"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "Speed",
"name": "Speed",
"type": "expression"
},
{
"description": "Deceleration",
"name": "Deceleration",
"type": "expression"
}
],
"objectGroups": []
},
{
"description": "Define JavaScript classes for top-down.",
"fullName": "Define JavaScript classes for top-down",
"functionType": "Action",
"name": "DefineJavaScriptForTopDown",
"private": true,
"sentence": "Define JavaScript classes for top-down",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"if (gdjs.__pixelPerfectExtension) {",
" return;",
"}",
"",
"const epsilon = 1 / (1 << 20);",
"",
"class PixelPerfectTopDownMovement {",
"",
" /**",
" * @param {gdjs.RuntimeBehavior} pixelPerfectBehavior",
" * @param {gdjs.TopDownMovementRuntimeBehavior} topDownBehavior",
" */",
" constructor(pixelPerfectBehavior, topDownBehavior) {",
" /** @type {gdjs.RuntimeBehavior} */",
" this.pixelPerfectBehavior = pixelPerfectBehavior;",
" /** @type {gdjs.TopDownMovementRuntimeBehavior} */",
" this.topDownBehavior = topDownBehavior;",
"",
" topDownBehavior.registerHook(this);",
"",
" /** @type {number | null} */",
" this.targetX = null;",
" /** @type {number | null} */",
" this.targetY = null;",
" this.targetDirectionX = 0;",
" this.targetDirectionY = 0;",
" this.lastDirection = -1;",
" this.isVelocityAdjusted = false;",
" this.isVelocityAdjustedOnX = false;",
" this.isVelocityAdjustedOnY = false;",
" }",
"",
" /**",
" * Return the direction to use instead of the direction given in",
" * parameter.",
" * @param {gdjs.TopDownMovementRuntimeBehavior.TopDownMovementHookContext} context",
" * @return {number}",
" */",
" overrideDirection(context) {",
" let direction = context.getDirection();",
" if (!this.pixelPerfectBehavior.activated()) {",
" return direction;",
" }",
"",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" const that = this.topDownBehavior;",
" const object = that.owner;",
"",
" if (cellSize <= 0 || that._allowDiagonals) {",
" return direction;",
" }",
"",
" // Forbid to turn before being aligned on the grid.",
"",
" const timeDelta = object.getElapsedTime() / 1000;",
" const deltaX = Math.abs(that._xVelocity * timeDelta);",
" const deltaY = Math.abs(that._yVelocity * timeDelta);",
"",
" const isTryingToMoveOnX = direction === 4 || direction === 0;",
" const isTryingToMoveOnY = direction === 6 || direction === 2;",
" if (isTryingToMoveOnX) {",
" if (that._yVelocity < 0) {",
" if (Math.abs(this.ceilToCellY(object.y) - object.y) > deltaY) {",
" direction = 6;",
" } else {",
" object.y = this.ceilToCellY(object.y);",
" }",
" }",
" if (that._yVelocity > 0) {",
" if (Math.abs(this.floorToCellY(object.y) - object.y) > deltaY) {",
" direction = 2;",
" } else {",
" object.y = this.floorToCellY(object.y);",
" }",
" }",
" } else if (isTryingToMoveOnY) {",
" if (that._xVelocity < 0) {",
" if (Math.abs(this.ceilToCellX(object.x) - object.x) > deltaX) {",
" direction = 4;",
" } else {",
" object.x = this.ceilToCellX(object.x);",
" }",
" }",
" if (that._xVelocity > 0) {",
" if (Math.abs(this.floorToCellX(object.x) - object.x) > deltaX) {",
" direction = 0;",
" } else {",
" object.x = this.floorToCellX(object.x);",
" }",
" }",
" }",
"",
" // Ensure sharp turn even with Verlet integrations.",
" const speed = Math.abs(that._xVelocity + that._yVelocity);",
" if (direction === 0) {",
" that._xVelocity = speed;",
" that._yVelocity = 0;",
" } else if (direction === 4) {",
" that._xVelocity = -speed;",
" that._yVelocity = 0;",
" } else if (direction === 2) {",
" that._yVelocity = speed;",
" that._xVelocity = 0;",
" } else if (direction === 6) {",
" that._yVelocity = -speed;",
" that._xVelocity = 0;",
" }",
"",
" this.lastDirection = direction;",
" return direction;",
" }",
"",
" /**",
" * Called before the acceleration and new direction is applied to the",
" * velocity.",
" * @param {gdjs.TopDownMovementRuntimeBehavior.TopDownMovementHookContext} context",
" */",
" beforeSpeedUpdate(context) {",
" if (!this.pixelPerfectBehavior.activated()) {",
" return;",
" }",
"",
" const direction = context.getDirection();",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" const that = this.topDownBehavior;",
" const object = that.owner;",
"",
" if (cellSize <= 0) {",
" return;",
" }",
"",
" const isMovingOnX =",
" direction !== -1 && direction !== 2 && direction !== 6;",
" if (isMovingOnX) {",
" this.targetX = null;",
" } else if (this.targetX === null) {",
" // Find where the deceleration should stop the object.",
" if (that._xVelocity > 0) {",
" this.targetX = this.ceilToCellX(",
" object.x + this.getBreakingDistanceX()",
" );",
" this.targetDirectionX = 1;",
" }",
" if (that._xVelocity < 0) {",
" this.targetX = this.floorToCellX(",
" object.x - this.getBreakingDistanceX()",
" );",
" this.targetDirectionX = -1;",
" }",
" }",
"",
" const isMovingOnY =",
" direction !== -1 && direction !== 0 && direction !== 4;",
" if (isMovingOnY) {",
" this.targetY = null;",
" } else if (this.targetY === null) {",
" // Find where the deceleration should stop the object.",
" if (that._yVelocity > 0) {",
" this.targetY = this.ceilToCellY(",
" object.y + this.getBreakingDistanceY()",
" );",
" this.targetDirectionY = 1;",
" }",
" if (that._yVelocity < 0) {",
" this.targetY = this.floorToCellY(",
" object.y - this.getBreakingDistanceY()",
" );",
" this.targetDirectionY = -1;",
" }",
" }",
"",
" // Make as if the player had press button a bit longer to reach exactly",
" // the next cell.",
"",
" this.isVelocityAdjustedOnX = this.targetX !== null;",
" if (this.isVelocityAdjustedOnX) {",
" if (this.targetDirectionX > 0) {",
" if (this.targetX > object.getX()) {",
" that._xVelocity = Math.min(",
" that._xVelocity + that._acceleration,",
" that._maxSpeed,",
" this.getSpeedToReach(this.targetX - object.getX())",
" );",
" }",
" const nextFrameX = object.getX() + that._xVelocity * object.getElapsedTime() / 1000;",
" if (this.targetX <= nextFrameX) {",
" that._xVelocity = 0;",
" object.setX(this.roundToCellX(object.getX()));",
" this.targetX = null;",
" }",
" }",
" if (this.targetDirectionX < 0) {",
" if (this.targetX < object.getX()) {",
" that._xVelocity = Math.max(",
" that._xVelocity - that._acceleration,",
" -that._maxSpeed,",
" this.getSpeedToReach(this.targetX - object.getX())",
" );",
" }",
" const nextFrameX = object.getX() + that._xVelocity * object.getElapsedTime() / 1000;",
" if (this.targetX >= nextFrameX) {",
" that._xVelocity = 0;",
" object.setX(this.roundToCellX(object.getX()));",
" this.targetX = null;",
" }",
" }",
" // The velocity is exact. There no need for Verlet integration.",
" this.previousVelocityX = that._xVelocity;",
" }",
"",
" this.isVelocityAdjustedOnY = this.targetY !== null;",
" if (this.isVelocityAdjustedOnY) {",
" if (this.targetDirectionY > 0) {",
" if (this.targetY > object.getY()) {",
" that._yVelocity = Math.min(",
" that._yVelocity + that._acceleration,",
" that._maxSpeed,",
" this.getSpeedToReach(this.targetY - object.getY())",
" );",
" }",
" const nextFrameY = object.getY() + that._yVelocity * object.getElapsedTime() / 1000;",
" if (this.targetY <= nextFrameY) {",
" that._yVelocity = 0;",
" object.setY(this.roundToCellY(object.getY()));",
" this.targetY = null;",
" }",
" }",
" if (this.targetDirectionY < 0) {",
" if (this.targetY < object.getY()) {",
" that._yVelocity = Math.max(",
" that._yVelocity - that._acceleration,",
" -that._maxSpeed,",
" this.getSpeedToReach(this.targetY - object.getY())",
" );",
" }",
" const nextFrameY = object.getY() + that._yVelocity * object.getElapsedTime() / 1000;",
" if (this.targetY >= nextFrameY) {",
" that._yVelocity = 0;",
" object.setY(this.roundToCellY(object.getY()));",
" this.targetY = null;",
" }",
" }",
" // The velocity is exact. There no need for Verlet integration.",
" this.previousVelocityY = that._yVelocity;",
" }",
" }",
"",
" /**",
" * Called before the velocity is applied to the object position and",
" * angle.",
" */",
" beforePositionUpdate() {",
" if (!this.pixelPerfectBehavior.activated()) {",
" return;",
" }",
"",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" if (cellSize <= 0) {",
" return;",
" }",
"",
" const that = this.topDownBehavior;",
"",
" if (this.isVelocityAdjustedOnX) {",
" // The velocity is exact. There no need for Verlet integration.",
" that._xVelocity = this.previousVelocityX;",
" }",
" if (this.isVelocityAdjustedOnY) {",
" // The velocity is exact. There no need for Verlet integration.",
" that._yVelocity = this.previousVelocityY;",
" }",
" }",
"",
" doStepPostEvents(instanceContainer) {",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" if (cellSize <= 0) {",
" return;",
" }",
"",
" const that = this.topDownBehavior;",
" const object = that.owner;",
"",
" const isMovingOnX =",
" this.lastDirection !== -1 &&",
" this.lastDirection !== 2 &&",
" this.lastDirection !== 6;",
" const isMovingOnY =",
" this.lastDirection !== -1 &&",
" this.lastDirection !== 0 &&",
" this.lastDirection !== 4;",
"",
" // Avoid rounding errors after a call to \"separate\" to make characters",
" // move indefinitely in front of a wall because they can't reach the cell.",
" if (!isMovingOnX && that._xVelocity !== 0) {",
" const x = object.getX();",
" const roundedX = this.roundToCellX(x);",
" if (Math.abs(roundedX - x) < epsilon) {",
" object.setX(roundedX);",
" this.targetDirectionX = 0;",
" that._xVelocity = 0;",
" }",
" }",
" if (!isMovingOnY && that._yVelocity !== 0) {",
" const y = object.getY();",
" const roundedY = this.roundToCellY(y);",
" if (Math.abs(roundedY - y) < epsilon) {",
" object.setY(roundedY);",
" this.targetDirectionY = 0;",
" that._yVelocity = 0;",
" }",
" }",
" }",
"",
" /**",
" * @returns {number} the braking distance according to an initial speed and a deceleration.",
" */",
" getBreakingDistanceX() {",
" const that = this.topDownBehavior;",
" return (that._xVelocity * that._xVelocity) / (2 * that._deceleration);",
" }",
"",
" /**",
" * @returns {number} the braking distance according to an initial speed and a deceleration.",
" */",
" getBreakingDistanceY() {",
" const that = this.topDownBehavior;",
" return (that._yVelocity * that._yVelocity) / (2 * that._deceleration);",
" }",
"",
" /**",
" * @param {number} displacement",
" * @returns {number} the speed necessary to cover a distance according to the deceleration.",
" */",
" getSpeedToReach(displacement) {",
" const that = this.topDownBehavior;",
" return (",
" Math.sign(displacement) *",
" Math.sqrt(2 * Math.abs(displacement) * that._deceleration)",
" );",
" }",
"",
" /**",
" * @param {number} x",
" * @return {number}",
" */",
" ceilToCellX(x) {",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" /** @type {number} */",
" const gridOffsetX = this.pixelPerfectBehavior._getOffsetX();",
"",
" return (",
" gridOffsetX +",
" cellSize * Math.ceil((x - gridOffsetX) / cellSize)",
" );",
" }",
"",
" /**",
" * @param {number} x",
" * @return {number}",
" */",
" roundToCellX(x) {",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" /** @type {number} */",
" const gridOffsetX = this.pixelPerfectBehavior._getOffsetX();",
"",
" return (",
" gridOffsetX +",
" cellSize * Math.round((x - gridOffsetX) / cellSize)",
" );",
" }",
"",
" /**",
" * @param {number} x",
" * @return {number}",
" */",
" floorToCellX(x) {",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" /** @type {number} */",
" const gridOffsetX = this.pixelPerfectBehavior._getOffsetX();",
"",
" return (",
" gridOffsetX +",
" cellSize * Math.floor((x - gridOffsetX) / cellSize)",
" );",
" }",
"",
" /**",
" * @param {number} y",
" * @return {number}",
" */",
" ceilToCellY(y) {",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" /** @type {number} */",
" const gridOffsetY = this.pixelPerfectBehavior._getOffsetY();",
"",
" return (",
" gridOffsetY +",
" cellSize * Math.ceil((y - gridOffsetY) / cellSize)",
" );",
" }",
"",
" /**",
" * @param {number} y",
" * @return {number}",
" */",
" roundToCellY(y) {",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" /** @type {number} */",
" const gridOffsetY = this.pixelPerfectBehavior._getOffsetY();",
"",
" return (",
" gridOffsetY +",
" cellSize * Math.round((y - gridOffsetY) / cellSize)",
" );",
" }",
"",
" /**",
" * @param {number} y",
" * @return {number}",
" */",
" floorToCellY(y) {",
" /** @type {number} */",
" const cellSize = this.pixelPerfectBehavior._getPixelSize();",
" /** @type {number} */",
" const gridOffsetY = this.pixelPerfectBehavior._getOffsetY();",
"",
" return (",
" gridOffsetY +",
" cellSize * Math.floor((y - gridOffsetY) / cellSize)",
" );",
" }",
"}",
"",
"gdjs.__pixelPerfectExtension = {",
" PixelPerfectTopDownMovement",
"}"
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"parameters": [],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "SpeedToReach"
},
{
"functionName": "BrakingDistance"
},
{
"functionName": "DefineJavaScriptForTopDown"
}
]
},
"eventsBasedBehaviors": [
{
"description": "Seamlessly align big pixels using a top-down movement.",
"fullName": "Pixel perfect top-down movement",
"helpPath": "",
"iconUrl": "",
"name": "PixelPerfectTopDownMovement",
"objectType": "",
"previewIconUrl": "",
"eventsFunctions": [
{
"fullName": "",
"functionType": "Action",
"name": "onCreated",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "PixelPerfectMovement::DefineJavaScriptForTopDown"
},
"parameters": [
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"\r",
"const object = objects[0];\r",
"const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");\r",
"const behavior = object.getBehavior(behaviorName);\r",
"\r",
"/** @type {gdjs.TopDownMovementRuntimeBehavior} */\r",
"const topDownBehavior = object.getBehavior(behavior._getTopDownMovement());\r",
"\r",
"const pixelPerfect = new gdjs.__pixelPerfectExtension.PixelPerfectTopDownMovement(behavior, topDownBehavior);\r",
"topDownBehavior.__pixelPerfect = pixelPerfect;\r",
"behavior.__pixelPerfect = pixelPerfect;\r",
""
],
"parameterObjects": "Object",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PixelPerfectMovement::PixelPerfectTopDownMovement",
"type": "behavior"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
"name": "doStepPostEvents",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const object = objects[0];",
"const behaviorName = eventsFunctionContext.getBehaviorName(\"Behavior\");",
"const behavior = object.getBehavior(behaviorName);",
"",
"behavior.__pixelPerfect.doStepPostEvents(runtimeScene);"
],
"parameterObjects": "Object",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PixelPerfectMovement::PixelPerfectTopDownMovement",
"type": "behavior"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "onCreated"
},
{
"functionName": "doStepPostEvents"
}
]
},
"propertyDescriptors": [
{
"value": "",
"type": "Behavior",
"label": "Top-down movement behavior",
"extraInformation": [
"TopDownMovementBehavior::TopDownMovementBehavior"
],
"choices": [],
"name": "TopDownMovement"
},
{
"value": "1",
"type": "Number",
"label": "Pixel size",
"name": "PixelSize"
},
{
"value": "0",
"type": "Number",
"label": "Pixel grid offset X",
"name": "OffsetX"
},
{
"value": "0",
"type": "Number",
"label": "Pixel grid offset Y",
"name": "OffsetY"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "TopDownMovement"
},
{
"propertyName": "PixelSize"
},
{
"propertyName": "OffsetX"
},
{
"propertyName": "OffsetY"
}
]
}
},
{
"description": "Seamlessly align big pixels using a 2D platformer character movement.",
"fullName": "Pixel perfect platformer character",
"helpPath": "",
"iconUrl": "",
"name": "PixelPerfectPlatformerCharacter",
"objectType": "",
"previewIconUrl": "",
"eventsFunctions": [
{
"fullName": "",
"functionType": "Action",
"name": "doStepPreEvents",
"sentence": "",
"events": [
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "X axis",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "We don't know if the deceleration was already applied or not this step, but if the speed drifted from more than 1%, another extension is probably modifying the speed and it must not be overridden."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsDecelerating",
"True",
""
]
},
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.PlatformerCharacter::CurrentSpeed() - PreviousSpeedX)",
"<",
"Object.PlatformerCharacter::CurrentSpeed() * 0.01 + Object.PlatformerCharacter::Deceleration() * TimeDelta()"
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Find how far to go to reach a pixel."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PlatformBehavior::CurrentSpeed"
},
"parameters": [
"Object",
"PlatformerCharacter",
">",
"0"
]
}
],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetX",
"=",
"OffsetX + PixelSize * ceil((Object.X() + PixelPerfectMovement::BrakingDistance(Object.PlatformerCharacter::CurrentSpeed(), Object.PlatformerCharacter::Deceleration()) - OffsetX) / PixelSize)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetDirectionX",
"=",
"1"
]
}
],
"events": [
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "DebuggerTools::ConsoleLog"
},
"parameters": [
"\"Target: \" + ToString(Object.X()) + \"-->\" + TargetX",
"",
""
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PlatformBehavior::CurrentSpeed"
},
"parameters": [
"Object",
"PlatformerCharacter",
"<",
"0"
]
}
],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetX",
"=",
"OffsetX + PixelSize * floor((Object.X() - PixelPerfectMovement::BrakingDistance(Object.PlatformerCharacter::CurrentSpeed(), Object.PlatformerCharacter::Deceleration()) - OffsetX) / PixelSize)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetDirectionX",
"=",
"-1"
]
}
],
"events": [
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "DebuggerTools::ConsoleLog"
},
"parameters": [
"\"Target: \" + ToString(Object.X()) + \"-->\" + TargetX",
"",
""
]
}
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Move to the target as the movement behavior would do."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PosX"
},
"parameters": [
"Object",
"<",
"TargetX"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionX",
"=",
"1"
]
}
],
"actions": [
{
"type": {
"value": "PlatformBehavior::PlatformerObjectBehavior::SetCurrentSpeed"
},
"parameters": [
"Object",
"PlatformerCharacter",
"=",
"min(Object.PlatformerCharacter::CurrentSpeed() + Object.PlatformerCharacter::Acceleration(), min(Object.PlatformerCharacter::MaxSpeed(), PixelPerfectMovement::SpeedToReach(TargetX - Object.X(), Object.PlatformerCharacter::Deceleration())))"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PosX"
},
"parameters": [
"Object",
">",
"TargetX"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionX",
"=",
"-1"
]
}
],
"actions": [
{
"type": {
"value": "PlatformBehavior::PlatformerObjectBehavior::SetCurrentSpeed"
},
"parameters": [
"Object",
"PlatformerCharacter",
"=",
"max(Object.PlatformerCharacter::CurrentSpeed() - Object.PlatformerCharacter::Acceleration(), max(-Object.PlatformerCharacter::MaxSpeed(), PixelPerfectMovement::SpeedToReach(TargetX - Object.X(), Object.PlatformerCharacter::Deceleration())))"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "BuiltinCommonInstructions::And"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "PosX"
},
"parameters": [
"Object",
">=",
"TargetX"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionX",
"=",
"1"
]
}
]
},
{
"type": {
"value": "BuiltinCommonInstructions::And"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "PosX"
},
"parameters": [
"Object",
"<=",
"TargetX"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionX",
"=",
"-1"
]
}
]
}
]
}
],
"actions": [
{
"type": {
"value": "SetX"
},
"parameters": [
"Object",
"=",
"OffsetX + PixelSize * round((Object.X() - OffsetX) / PixelSize)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetDirectionX",
"=",
"0"
]
},
{
"type": {
"value": "PlatformBehavior::PlatformerObjectBehavior::SetCurrentSpeed"
},
"parameters": [
"Object",
"PlatformerCharacter",
"=",
"0"
]
}
],
"events": [
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "DebuggerTools::ConsoleLog"
},
"parameters": [
"\"X: \" + ToString(Object.X()) + \" Speed: \" + ToString(Object.PlatformerCharacter::CurrentSpeed())",
"",
""
]
}
]
}
]
}
]
}
],
"parameters": []
},
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Ladder",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PlatformBehavior::IsOnLadder"
},
"parameters": [
"Object",
"PlatformerCharacter"
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Find how far to go to reach a pixel."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl"
},
"parameters": [
"Object",
"PlatformerCharacter",
"\"Down\""
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl"
},
"parameters": [
"Object",
"PlatformerCharacter",
"\"Up\""
]
}
],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetY",
"=",
"OffsetY + PixelSize * ceil((Object.Y() - OffsetY) / PixelSize)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetDirectionY",
"=",
"1"
]
}
],
"events": [
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "DebuggerTools::ConsoleLog"
},
"parameters": [
"\"Target: \" + ToString(Object.Y()) + \"-->\" + TargetY",
"",
""
]
}
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl"
},
"parameters": [
"Object",
"PlatformerCharacter",
"\"Up\""
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl"
},
"parameters": [
"Object",
"PlatformerCharacter",
"\"Down\""
]
}
],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetY",
"=",
"OffsetY + PixelSize * floor((Object.Y() - OffsetY) / PixelSize)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetDirectionY",
"=",
"-1"
]
}
],
"events": [
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "DebuggerTools::ConsoleLog"
},
"parameters": [
"\"Target: \" + ToString(Object.Y()) + \"-->\" + TargetY",
"",
""
]
}
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Move to the target as the movement behavior would do."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl"
},
"parameters": [
"Object",
"PlatformerCharacter",
"\"Up\""
]
},
{
"type": {
"inverted": true,
"value": "PlatformBehavior::PlatformerObjectBehavior::IsUsingControl"
},
"parameters": [
"Object",
"PlatformerCharacter",
"\"Down\""
]
}
],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PosY"
},
"parameters": [
"Object",
"<",
"TargetY"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionY",
"=",
"1"
]
}
],
"actions": [
{
"type": {
"value": "SetY"
},
"parameters": [
"Object",
"+",
"Object.PlatformerCharacter::MaxSpeed() * TimeDelta()"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PosY"
},
"parameters": [
"Object",
">",
"TargetY"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionY",
"=",
"-1"
]
}
],
"actions": [
{
"type": {
"value": "SetY"
},
"parameters": [
"Object",
"-",
"Object.PlatformerCharacter::MaxSpeed() * TimeDelta()"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "BuiltinCommonInstructions::And"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "PosY"
},
"parameters": [
"Object",
">=",
"TargetY"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionY",
"=",
"1"
]
}
]
},
{
"type": {
"value": "BuiltinCommonInstructions::And"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "PosY"
},
"parameters": [
"Object",
"<=",
"TargetY"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TargetDirectionY",
"=",
"-1"
]
}
]
}
]
}
],
"actions": [
{
"type": {
"value": "SetY"
},
"parameters": [
"Object",
"=",
"OffsetY + PixelSize * round((Object.Y() - OffsetY) / PixelSize)"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TargetDirectionY",
"=",
"0"
]
}
]
},
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "DebuggerTools::ConsoleLog"
},
"parameters": [
"\"X: \" + ToString(Object.X()) + \" Speed: \" + ToString(Object.PlatformerCharacter::CurrentSpeed())",
"",
""
]
}
]
}
]
}
]
}
],
"parameters": []
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PixelPerfectMovement::PixelPerfectPlatformerCharacter",
"type": "behavior"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
"name": "doStepPostEvents",
"sentence": "",
"events": [
{
"disabled": true,
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.PlatformerCharacter::CurrentSpeed())",
"!=",
"0"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.PlatformerCharacter::CurrentSpeed())",
"!=",
"Object.PlatformerCharacter::MaxSpeed()"
]
}
],
"actions": [
{
"type": {
"value": "DebuggerTools::ConsoleLog"
},
"parameters": [
"ToString(abs(PreviousSpeedX) - Object.PlatformerCharacter::Deceleration() * TimeDelta() - abs(Object.PlatformerCharacter::CurrentSpeed()))",
"",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Check if the character is decelerating.\nIt's done in doStepPostEvent because there is no way to know if the doStepPreEvents of this behavior is executed before or after the one of PlatformerCharcter.\nAs TimeDelta is used, we have to be sure the last PlatformerCharcter.doStepPreEvents call used the same TimeDelta. Which means this must be done after PlatformerCharcter.doStepPreEvents."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"IsDecelerating",
"False",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "PlatformBehavior::CurrentSpeed"
},
"parameters": [
"Object",
"PlatformerCharacter",
"=",
"0"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::CompareNumbers"
},
"parameters": [
"abs(Object.PlatformerCharacter::CurrentSpeed())",
"=",
"abs(PreviousSpeedX) - Object.PlatformerCharacter::Deceleration() * TimeDelta()"
]
}
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"IsDecelerating",
"True",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Save the speed to detect speed changes from outside."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"PreviousSpeedX",
"=",
"Object.PlatformerCharacter::CurrentSpeed()"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PixelPerfectMovement::PixelPerfectPlatformerCharacter",
"type": "behavior"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "doStepPreEvents"
},
{
"functionName": "doStepPostEvents"
}
]
},
"propertyDescriptors": [
{
"value": "",
"type": "Behavior",
"label": "Platformer character behavior",
"extraInformation": [
"PlatformBehavior::PlatformerObjectBehavior"
],
"choices": [],
"name": "PlatformerCharacter"
},
{
"value": "1",
"type": "Number",
"label": "Pixel size",
"name": "PixelSize"
},
{
"value": "0",
"type": "Number",
"label": "Pixel grid offset X",
"name": "OffsetX"
},
{
"value": "0",
"type": "Number",
"label": "Pixel grid offset Y",
"name": "OffsetY"
},
{
"value": "0",
"type": "Number",
"label": "",
"hidden": true,
"name": "TargetX"
},
{
"value": "0",
"type": "Number",
"label": "",
"hidden": true,
"name": "TargetDirectionX"
},
{
"value": "0",
"type": "Number",
"label": "",
"hidden": true,
"name": "TargetY"
},
{
"value": "0",
"type": "Number",
"label": "",
"hidden": true,
"name": "TargetDirectionY"
},
{
"value": "",
"type": "Number",
"label": "",
"hidden": true,
"name": "PreviousSpeedX"
},
{
"value": "",
"type": "Boolean",
"label": "",
"hidden": true,
"name": "IsDecelerating"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "PlatformerCharacter"
},
{
"propertyName": "PixelSize"
},
{
"propertyName": "OffsetX"
},
{
"propertyName": "OffsetY"
},
{
"propertyName": "TargetX"
},
{
"propertyName": "TargetDirectionX"
},
{
"propertyName": "TargetY"
},
{
"propertyName": "TargetDirectionY"
},
{
"propertyName": "PreviousSpeedX"
},
{
"propertyName": "IsDecelerating"
}
]
}
}
],
"eventsBasedObjects": []
},
{
"author": "Arthur Pacaud (arthuro555)",
"category": "Advanced",
"dimension": "",
"extensionNamespace": "",
"fullName": "Unique Identifiers",
"gdevelopVersion": ">=5.5.222",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWlkZW50aWZpZXIiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiwxOFY4SDhWMThINk02LDQuNUg4VjYuNUg2VjQuNU0xNyw0SDE5VjE4SDE3VjE3Ljc1QzE3LDE3Ljc1IDE1LjY3LDE4IDE1LDE4QTUsNSAwIDAsMSAxMCwxM0E1LDUgMCAwLDEgMTUsOEMxNS42Nyw4IDE3LDguMjUgMTcsOC4yNVY0TTE3LDEwLjI1QzE3LDEwLjI1IDE1LjY3LDEwIDE1LDEwQTMsMyAwIDAsMCAxMiwxM0EzLDMgMCAwLDAgMTUsMTZDMTUuNjcsMTYgMTcsMTUuNzUgMTcsMTUuNzVWMTAuMjVaIiAvPjwvc3ZnPg==",
"name": "UUID",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/identifier.svg",
"shortDescription": "Generate unique identifiers: UUIDv4 random strings and incremented integer UIDs.",
"version": "1.0.0",
"description": [
"Adds UUID (Universally Unique Identifiers) generation expressions via multiple patterns:",
"- UUIDv4: Creates a long random string of characters following the UUIDv4 standard. If available on the system/browser, will use a cryptographic random number generator, otherwise uses the same pseudorandom number generator as the `Random()` expression. Chances of collisions are extremely low, but not non-existent. As the return value is a string, it may not be the most performant pattern. It can not be predicted in most cases.",
"- Incremented integer: Returns use an integer that will be incremented after each call. Very performant and no risk of collisions. The UID will be predictable, so it may be vulnerable to some cryptographic attacks if used for private unique tokens, like password reset verification UID. Note that if you store IDs and then restart the game, there may be duplicates, since it'll reset the counter."
],
"origin": {
"identifier": "UUID",
"name": "gdevelop-extension-store"
},
"tags": [
"random",
"generation",
"uid",
"uuid",
"guid",
"v4",
"unique",
"id",
"identifier"
],
"authorIds": [
"ZgrsWuRTAkXgeuPV9bo0zuEcA2w1"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Generates a unique identifier with the UUIDv4 pattern.",
"fullName": "Generate a UUIDv4",
"functionType": "StringExpression",
"name": "GenerateUUIDv4",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"// Use the engine implementation of UUIDv4.",
"eventsFunctionContext.returnValue = gdjs.makeUuid();",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"expressionType": {
"type": "string"
},
"parameters": [],
"objectGroups": []
},
{
"description": "Generates a unique identifier with the incremented integer pattern.",
"fullName": "Generate an incremented integer UID",
"functionType": "Expression",
"name": "GenerateIncrementedIntegerUID",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"GlobalVariable(__UUID_IncrementedInteger)"
]
},
{
"type": {
"value": "ModVarGlobal"
},
"parameters": [
"__UUID_IncrementedInteger",
"+",
"1"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "GenerateUUIDv4"
},
{
"functionName": "GenerateIncrementedIntegerUID"
}
]
},
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
},
{
"author": "Silver-Streak, @Bouh, Tristan Rhodes",
"category": "Game mechanic",
"dimension": "2D",
"extensionNamespace": "",
"fullName": "Object \"Is On Screen\" Detection",
"gdevelopVersion": "",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLW1vbml0b3Itc2NyZWVuc2hvdCIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiPjxwYXRoIGQ9Ik05LDZINVYxMEg3VjhIOU0xOSwxMEgxN1YxMkgxNVYxNEgxOU0yMSwxNkgzVjRIMjFNMjEsMkgzQzEuODksMiAxLDIuODkgMSw0VjE2QTIsMiAwIDAsMCAzLDE4SDEwVjIwSDhWMjJIMTZWMjBIMTRWMThIMjFBMiwyIDAgMCwwIDIzLDE2VjRDMjMsMi44OSAyMi4xLDIgMjEsMiIgLz48L3N2Zz4=",
"name": "IsOnScreen",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/monitor-screenshot.svg",
"shortDescription": "Condition to check if an object is visible in its layer's camera viewport.",
"version": "1.2.2",
"description": [
"This extension adds conditions to check if an object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.",
"",
"Note that this does not take into account any object visibility, such as being hidden or 0 opacity, but can be combined with those existing conditions."
],
"origin": {
"identifier": "IsOnScreen",
"name": "gdevelop-extension-store"
},
"tags": [
"is on screen",
"condition",
"visible",
"hide",
"screen"
],
"authorIds": [
"2OwwM8ToR9dx9RJ2sAKTcrLmCB92",
"8Ih1aa8f5gWUp4UB2BdhQ2iXWxJ3",
"gqDaZjCfevOOxBYkK6zlhtZnXCg1"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT"
},
"eventsBasedBehaviors": [
{
"description": "This behavior provides a condition to check if the object is located within the visible portion of its layer's camera. The condition also allows for specifying padding to the virtual screen border.\nNote that object visibility, such as being hidden or 0 opacity, is not considered (but you can use those existing conditions in addition to this behavior).",
"fullName": "Is on screen",
"helpPath": "",
"iconUrl": "",
"name": "InOnScreen",
"objectType": "",
"previewIconUrl": "",
"quickCustomizationVisibility": "hidden",
"eventsFunctions": [
{
"description": "Checks if an object position is within the viewport of its layer.",
"fullName": "Is on screen",
"functionType": "Condition",
"name": "IsOnScreen",
"sentence": "_PARAM0_ is on screen (padded by _PARAM2_ pixels)",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"/*",
"Get the object layer, convert the position from this layer to the screen coordinates.",
"Get the point on each side on the object on screen, and compare with the screen area.",
"",
"This way even if the camera has a rotation or custom scale the object is always compared to the screen area.",
"*/",
"",
"",
"// Get the layer of the object.",
"const object = objects[0];",
"const layer = runtimeScene.getLayer(object.getLayer());",
"",
"// Get the aabb of the object on his layer.",
"const aabb = object.getVisibilityAABB();",
"",
"// Get the layer to convert the coordinates of the AABB to the screen coordinates",
"const topLeft = layer.convertInverseCoords(aabb.min[0], aabb.min[1]);",
"const topRight = layer.convertInverseCoords(aabb.max[0], aabb.min[1]);",
"const bottomRight = layer.convertInverseCoords(aabb.max[0], aabb.max[1]);",
"const bottomLeft = layer.convertInverseCoords(aabb.min[0], aabb.max[1]);",
"",
"// Get the points on each side of the object on screen.",
"const posLeftObjectOnScreen = Math.min(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);",
"const posRightObjectOnScreen = Math.max(topLeft[0], topRight[0], bottomLeft[0], bottomRight[0]);",
"const posUpObjectOnScreen = Math.min(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);",
"const posDownObjectOnScreen = Math.max(topLeft[1], topRight[1], bottomLeft[1], bottomRight[1]);",
"",
"const padding = eventsFunctionContext.getArgument(\"Padding\");",
"",
"if (",
" !(posLeftObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionWidth() ||",
" posUpObjectOnScreen - padding > runtimeScene.getGame().getGameResolutionHeight() ||",
" posRightObjectOnScreen + padding < 0 ||",
" posDownObjectOnScreen + padding < 0",
" )",
") {",
" eventsFunctionContext.returnValue = true;",
"}",
""
],
"parameterObjects": "Object",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "IsOnScreen::InOnScreen",
"type": "behavior"
},
{
"description": "Padding (in pixels)",
"longDescription": "Number of pixels to pad the screen border. Zero by default. A negative value goes inside the screen, a positive value go outside.",
"name": "Padding",
"type": "expression"
}
],
"objectGroups": [
{
"name": "Group",
"objects": []
}
]
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "IsOnScreen"
}
]
},
"propertyDescriptors": [],
"propertiesFolderStructure": {
"folderName": "__ROOT"
}
}
],
"eventsBasedObjects": []
},
{
"author": "",
"category": "User interface",
"dimension": "2D",
"extensionNamespace": "",
"fullName": "Labeled button",
"gdevelopVersion": ">=5.5.230",
"helpPath": "/objects/button",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI5LDIzSDNjLTEuMSwwLTItMC45LTItMlYxMWMwLTEuMSwwLjktMiwyLTJoMjZjMS4xLDAsMiwwLjksMiwydjEwQzMxLDIyLjEsMzAuMSwyMywyOSwyM3oiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMywxOUwxMywxOWMtMS4xLDAtMi0wLjktMi0ydi0yYzAtMS4xLDAuOS0yLDItMmgwYzEuMSwwLDIsMC45LDIsMnYyQzE1LDE4LjEsMTQuMSwxOSwxMywxOXoiLz4NCjxsaW5lIGNsYXNzPSJzdDAiIHgxPSIxOCIgeTE9IjEzIiB4Mj0iMTgiIHkyPSIxOSIvPg0KPGxpbmUgY2xhc3M9InN0MCIgeDE9IjIxIiB5MT0iMTMiIHgyPSIxOCIgeTI9IjE3Ii8+DQo8bGluZSBjbGFzcz0ic3QwIiB4MT0iMjEiIHkxPSIxOSIgeDI9IjE5IiB5Mj0iMTYiLz4NCjwvc3ZnPg0K",
"name": "PanelSpriteButton",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/Line Hero Pack/Master/SVG/Interface Elements/Interface Elements_interface_ui_button_ok_cta_clock_tap.svg",
"shortDescription": "Resizeable button with a label.",
"version": "2.2.1",
"description": [
"A button that can be used for menus and most labelled buttons of a game. The button can be customized with a background for each state and a label. It handles user interactions and a simple condition can be used to check if it is clicked.",
"",
"There are ready-to-use buttons in the asset-store [menu buttons pack](https://editor.gdevelop.io/?initial-dialog=asset-store&asset-pack=menu-buttons-menu-buttons)."
],
"origin": {
"identifier": "PanelSpriteButton",
"name": "gdevelop-extension-store"
},
"tags": [
"button",
"ui"
],
"authorIds": [
"IWykYNRvhCZBN3vEgKEbBPOR3Oc2"
],
"changelog": [
{
"version": "2.0.0",
"breaking": "- Buttons now use \"variants\", allowing easy swapping of their visual aspect. You will have to make some adjustments to existing buttons in your project. Follow this [migration documentation](https://wiki.gdevelop.io/gdevelop5/objects/custom-objects-prefab-template/migrate-to-variants/) to do these changes."
}
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Check if the events are running for the editor.",
"fullName": "Editor is running",
"functionType": "Condition",
"name": "IsInGameEdition",
"private": true,
"sentence": "Events are running for the editor",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"const game = runtimeScene.getGame();\r",
"eventsFunctionContext.returnValue = game.isInGameEdition && game.isInGameEdition();"
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "IsInGameEdition"
}
]
},
"eventsBasedBehaviors": [
{
"description": "The finite state machine used internally by the button object.",
"fullName": "Button finite state machine",
"helpPath": "",
"iconUrl": "",
"name": "ButtonFSM",
"objectType": "",
"previewIconUrl": "",
"private": true,
"eventsFunctions": [
{
"fullName": "",
"functionType": "Action",
"name": "doStepPostEvents",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "PanelSpriteButton::IsInGameEdition"
},
"parameters": [
"",
""
]
}
],
"actions": [],
"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": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Validated\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"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": "SetBooleanVariable"
},
"parameters": [
"MouseIsInside",
"False",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"ShouldCheckHovering",
"True",
""
]
},
{
"type": {
"value": "CollisionPoint"
},
"parameters": [
"Object",
"MouseOnlyCursorX(Object.Layer(), 0)",
"MouseOnlyCursorY(Object.Layer(), 0)"
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"MouseIsInside",
"True",
""
]
}
]
},
{
"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": "SetBooleanVariable"
},
"parameters": [
"TouchIsInside",
"False",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"TouchId",
"!=",
"0"
]
},
{
"type": {
"value": "CollisionPoint"
},
"parameters": [
"Object",
"TouchX(TouchId, Object.Layer(), 0)",
"TouchY(TouchId, Object.Layer(), 0)"
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"TouchIsInside",
"True",
""
]
}
]
}
],
"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": "SetNumberVariable"
},
"parameters": [
"Index",
"=",
"0"
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Repeat",
"repeatExpression": "StartedTouchOrMouseCount()",
"conditions": [],
"actions": [],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "CollisionPoint"
},
"parameters": [
"Object",
"TouchX(StartedTouchOrMouseId(Index), Object.Layer(), 0)",
"TouchY(StartedTouchOrMouseId(Index), Object.Layer(), 0)"
]
}
],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TouchId",
"=",
"StartedTouchOrMouseId(Index)"
]
},
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"TouchIsInside",
"True",
""
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "PanelSpriteButton::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Hovered\""
]
},
{
"type": {
"value": "PanelSpriteButton::ButtonFSM::PropertyState"
},
"parameters": [
"Object",
"Behavior",
"=",
"\"Idle\""
]
}
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"PressedInside\""
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"Index",
"+",
"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": "BooleanVariable"
},
"parameters": [
"MouseIsInside",
"True",
""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Hovered\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"Idle\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"MouseIsInside",
"True",
""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Idle\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"Hovered\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "BooleanVariable"
},
"parameters": [
"TouchIsInside",
"True",
""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"PressedInside\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"PressedOutside\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"TouchIsInside",
"True",
""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"PressedOutside\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"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": [
"",
"TouchId"
]
}
],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TouchId",
"=",
"0"
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"PressedInside\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"Validated\""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"PressedInside\""
]
},
{
"type": {
"inverted": true,
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Validated\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"Idle\""
]
}
]
}
]
}
],
"parameters": []
}
],
"parameters": []
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::ButtonFSM",
"type": "behavior"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
"name": "onDeActivate",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "PanelSpriteButton::ButtonFSM::ResetState"
},
"parameters": [
"Object",
"Behavior",
""
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::ButtonFSM",
"type": "behavior"
}
],
"objectGroups": []
},
{
"description": "Reset the state of the button.",
"fullName": "Reset state",
"functionType": "Action",
"name": "ResetState",
"private": true,
"sentence": "Reset the button state of _PARAM0_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"State",
"=",
"\"Idle\""
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"TouchId",
"=",
"0"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::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": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Idle\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::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": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Validated\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::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": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Hovered\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::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": "StringVariable"
},
"parameters": [
"State",
"=",
"\"Hovered\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"State",
"=",
"\"PressedOutside\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::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": "StringVariable"
},
"parameters": [
"State",
"=",
"\"PressedInside\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::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": "StringVariable"
},
"parameters": [
"State",
"=",
"\"PressedOutside\""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::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": [
"TouchId"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "Object",
"name": "Object",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::ButtonFSM",
"type": "behavior"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "doStepPostEvents"
},
{
"functionName": "onDeActivate"
},
{
"functionName": "ResetState"
},
{
"functionName": "IsIdle"
},
{
"functionName": "IsClicked"
},
{
"functionName": "IsHovered"
},
{
"functionName": "IsFocused"
},
{
"functionName": "IsPressed"
},
{
"functionName": "IsPressedOutside"
},
{
"functionName": "TouchId"
}
]
},
"propertyDescriptors": [
{
"value": "true",
"type": "Boolean",
"label": "",
"description": "Should check hovering",
"hidden": true,
"name": "ShouldCheckHovering"
},
{
"value": "Idle",
"type": "Choice",
"label": "State",
"choices": [
{
"label": "Idle",
"value": "Idle"
},
{
"label": "Hovered",
"value": "Hovered"
},
{
"label": "PressedInside",
"value": "PressedInside"
},
{
"label": "PressedOutside",
"value": "PressedOutside"
},
{
"label": "Validated",
"value": "Validated"
}
],
"hidden": true,
"name": "State"
},
{
"value": "0",
"type": "Number",
"label": "Touch id",
"hidden": true,
"name": "TouchId"
},
{
"value": "",
"type": "Boolean",
"label": "Touch is inside",
"hidden": true,
"name": "TouchIsInside"
},
{
"value": "",
"type": "Boolean",
"label": "Mouse is inside",
"hidden": true,
"name": "MouseIsInside"
},
{
"value": "",
"type": "Number",
"label": "",
"hidden": true,
"name": "Index"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "ShouldCheckHovering"
},
{
"propertyName": "State"
},
{
"propertyName": "TouchId"
},
{
"propertyName": "TouchIsInside"
},
{
"propertyName": "MouseIsInside"
},
{
"propertyName": "Index"
}
]
}
},
{
"description": "Change the text style when the button is hovered.",
"fullName": "Hover text style",
"helpPath": "",
"iconUrl": "",
"name": "TextStyleState",
"objectType": "TextObject::Text",
"previewIconUrl": "",
"private": true,
"eventsFunctions": [
{
"description": "Check if isHovered.",
"fullName": "IsHovered",
"functionType": "Condition",
"name": "IsHovered",
"sentence": "_PARAM0_ isHovered",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsHovered",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "TextObject::Text",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::TextStyleState",
"type": "behavior"
}
],
"objectGroups": []
},
{
"description": "Change if isHovered.",
"fullName": "IsHovered",
"functionType": "Action",
"name": "SetIsHovered",
"sentence": "_PARAM0_ isHovered: _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsHovered",
"False",
""
]
},
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"Value",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"IsHovered",
"True",
""
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"HoverFontSize",
">",
"0"
]
}
],
"actions": [
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"IdleFontSize",
"=",
"Object.FontSize()"
]
},
{
"type": {
"value": "TextObject::Text::SetFontSize"
},
"parameters": [
"Object",
"=",
"HoverFontSize"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverColor",
"!=",
"\"\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"IdleColor",
"=",
"Object.Behavior::Color()"
]
},
{
"type": {
"value": "TextObject::ChangeColor"
},
"parameters": [
"Object",
"HoverColor"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"ShouldEnableShadowOnHover",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "TextObject::ShowShadow"
},
"parameters": [
"Object",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"ShouldEnableOutlineOnHover",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "TextObject::Text::SetOutlineEnabled"
},
"parameters": [
"Object",
"yes"
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsHovered",
"True",
""
]
},
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"Value",
"False",
""
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"IsHovered",
"False",
""
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"HoverFontSize",
">",
"0"
]
}
],
"actions": [
{
"type": {
"value": "TextObject::Text::SetFontSize"
},
"parameters": [
"Object",
"=",
"IdleFontSize"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverColor",
"!=",
"\"\""
]
}
],
"actions": [
{
"type": {
"value": "TextObject::ChangeColor"
},
"parameters": [
"Object",
"IdleColor"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"ShouldEnableShadowOnHover",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "TextObject::ShowShadow"
},
"parameters": [
"Object",
"no"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"ShouldEnableOutlineOnHover",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "TextObject::Text::SetOutlineEnabled"
},
"parameters": [
"Object",
"no"
]
}
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "TextObject::Text",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::TextStyleState",
"type": "behavior"
},
{
"defaultValue": "yes",
"description": "IsHovered",
"name": "Value",
"optional": true,
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Return the text color",
"fullName": "Text color",
"functionType": "StringExpression",
"name": "Color",
"private": true,
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"/** @type {gdjs.TextRuntimeObject} */",
"const object = eventsFunctionContext.getObjects(\"Object\")[0];",
"",
"eventsFunctionContext.returnValue = object._color.join(\";\");"
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"expressionType": {
"type": "color"
},
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "TextObject::Text",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::TextStyleState",
"type": "behavior"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "IsHovered"
},
{
"functionName": "SetIsHovered"
},
{
"functionName": "Color"
}
]
},
"propertyDescriptors": [
{
"value": "",
"type": "Boolean",
"label": "Outline on hover",
"name": "ShouldEnableOutlineOnHover"
},
{
"value": "",
"type": "Color",
"label": "Hover color",
"name": "HoverColor"
},
{
"value": "",
"type": "Boolean",
"label": "Enable shadow on hover",
"name": "ShouldEnableShadowOnHover"
},
{
"value": "0",
"type": "Number",
"unit": "Pixel",
"label": "Hover font size",
"name": "HoverFontSize"
},
{
"value": "",
"type": "Boolean",
"label": "",
"hidden": true,
"name": "IsHovered"
},
{
"value": "0",
"type": "Number",
"unit": "Pixel",
"label": "Idle font size",
"hidden": true,
"name": "IdleFontSize"
},
{
"value": "",
"type": "Color",
"label": "Idle color",
"hidden": true,
"name": "IdleColor"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "IsHovered"
},
{
"propertyName": "HoverFontSize"
},
{
"propertyName": "IdleFontSize"
},
{
"propertyName": "HoverColor"
},
{
"propertyName": "IdleColor"
},
{
"propertyName": "ShouldEnableOutlineOnHover"
},
{
"propertyName": "ShouldEnableShadowOnHover"
}
]
}
},
{
"description": "Change the text style when the button is hovered.",
"fullName": "Hover bitmap text style",
"helpPath": "",
"iconUrl": "",
"name": "BitmapTextStyleState",
"objectType": "BitmapText::BitmapTextObject",
"previewIconUrl": "",
"private": true,
"eventsFunctions": [
{
"description": "Check if isHovered.",
"fullName": "IsHovered",
"functionType": "Condition",
"name": "IsHovered",
"sentence": "_PARAM0_ isHovered",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsHovered",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "BitmapText::BitmapTextObject",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::BitmapTextStyleState",
"type": "behavior"
}
],
"objectGroups": []
},
{
"description": "Change if isHovered.",
"fullName": "IsHovered",
"functionType": "Action",
"name": "SetIsHovered",
"sentence": "_PARAM0_ isHovered: _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsHovered",
"False",
""
]
},
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"Value",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"IsHovered",
"True",
""
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverColor",
"!=",
"\"\""
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"IdleColor",
"=",
"Object.Behavior::Color()"
]
},
{
"type": {
"value": "BitmapText::SetTint"
},
"parameters": [
"Object",
"HoverColor"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverPrefix",
"!=",
"\"\""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverSuffix",
"!=",
"\"\""
]
}
]
}
],
"actions": [
{
"type": {
"value": "SetStringVariable"
},
"parameters": [
"IdleText",
"=",
"Object.Text::Value()"
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"Object",
"Text",
"=",
"HoverPrefix + Object.Text::Value() + HoverSuffix"
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"IsHovered",
"True",
""
]
},
{
"type": {
"value": "BooleanVariable"
},
"parameters": [
"Value",
"False",
""
]
}
],
"actions": [
{
"type": {
"value": "SetBooleanVariable"
},
"parameters": [
"IsHovered",
"False",
""
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverColor",
"!=",
"\"\""
]
}
],
"actions": [
{
"type": {
"value": "BitmapText::SetTint"
},
"parameters": [
"Object",
"IdleColor"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "BuiltinCommonInstructions::Or"
},
"parameters": [],
"subInstructions": [
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverPrefix",
"!=",
"\"\""
]
},
{
"type": {
"value": "StringVariable"
},
"parameters": [
"HoverSuffix",
"!=",
"\"\""
]
}
]
}
],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"Object",
"Text",
"=",
"IdleText"
]
}
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "BitmapText::BitmapTextObject",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::BitmapTextStyleState",
"type": "behavior"
},
{
"defaultValue": "yes",
"description": "IsHovered",
"name": "Value",
"optional": true,
"type": "yesorno"
}
],
"objectGroups": []
},
{
"description": "Return the text color",
"fullName": "Text color",
"functionType": "StringExpression",
"name": "Color",
"private": true,
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"/** @type {gdjs.BitmapTextRuntimeObject} */",
"const object = eventsFunctionContext.getObjects(\"Object\")[0];",
"",
"eventsFunctionContext.returnValue = object._tint.join(\";\");"
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"expressionType": {
"type": "color"
},
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "BitmapText::BitmapTextObject",
"type": "object"
},
{
"description": "Behavior",
"name": "Behavior",
"supplementaryInformation": "PanelSpriteButton::BitmapTextStyleState",
"type": "behavior"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "IsHovered"
},
{
"functionName": "SetIsHovered"
},
{
"functionName": "Color"
}
]
},
"propertyDescriptors": [
{
"value": "",
"type": "Color",
"label": "Hover color",
"name": "HoverColor"
},
{
"value": "",
"type": "String",
"label": "Hover prefix",
"name": "HoverPrefix"
},
{
"value": "",
"type": "String",
"label": "Hover suffix",
"name": "HoverSuffix"
},
{
"value": "",
"type": "Boolean",
"label": "",
"hidden": true,
"name": "IsHovered"
},
{
"value": "",
"type": "String",
"label": "Idle text",
"hidden": true,
"name": "IdleText"
},
{
"value": "",
"type": "Color",
"label": "Idle color",
"hidden": true,
"name": "IdleColor"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "IsHovered"
},
{
"propertyName": "HoverPrefix"
},
{
"propertyName": "HoverSuffix"
},
{
"propertyName": "IdleText"
},
{
"propertyName": "HoverColor"
},
{
"propertyName": "IdleColor"
}
]
}
}
],
"eventsBasedObjects": [
{
"areaMaxX": 256,
"areaMaxY": 64,
"areaMaxZ": 64,
"areaMinX": 0,
"areaMinY": 0,
"areaMinZ": 0,
"assetStoreTag": "menu buttons",
"defaultName": "Button",
"description": "Button with a label.",
"fullName": "Labeled button",
"helpPath": "",
"iconUrl": "",
"isInnerAreaFollowingParentSize": true,
"isUsingLegacyInstancesRenderer": false,
"name": "PanelSpriteButton",
"previewIconUrl": "",
"objects": [
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "Label",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 4,
"topEdgeAnchor": 4,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "TextStyleState",
"type": "PanelSpriteButton::TextStyleState",
"ShouldEnableOutlineOnHover": false,
"HoverColor": "",
"ShouldEnableShadowOnHover": false,
"HoverFontSize": 0,
"IsHovered": false,
"IdleFontSize": 0,
"IdleColor": ""
}
],
"string": "Text",
"font": "",
"textAlignment": "center",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Text",
"font": "",
"textAlignment": "center",
"verticalTextAlignment": "center",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
},
{
"assetStoreId": "",
"bottomMargin": 0,
"height": 32,
"leftMargin": 0,
"name": "Idle",
"rightMargin": 0,
"texture": "",
"tiled": false,
"topMargin": 0,
"type": "PanelSpriteObject::PanelSprite",
"width": 32,
"variables": [
{
"folded": true,
"name": "State",
"type": "string",
"value": "Idle"
}
],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 2,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"topEdgeAnchor": 1,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "ButtonFSM",
"type": "PanelSpriteButton::ButtonFSM",
"ShouldCheckHovering": true
}
]
},
{
"assetStoreId": "",
"bottomMargin": 0,
"height": 32,
"leftMargin": 0,
"name": "Hovered",
"rightMargin": 0,
"texture": "",
"tiled": false,
"topMargin": 0,
"type": "PanelSpriteObject::PanelSprite",
"width": 32,
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 2,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"topEdgeAnchor": 1,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "Tween",
"type": "Tween::TweenBehavior"
}
]
},
{
"assetStoreId": "",
"bottomMargin": 0,
"height": 32,
"leftMargin": 0,
"name": "Pressed",
"rightMargin": 0,
"texture": "",
"tiled": false,
"topMargin": 0,
"type": "PanelSpriteObject::PanelSprite",
"width": 32,
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 2,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"topEdgeAnchor": 1,
"useLegacyBottomAndRightAnchors": false
}
]
},
{
"assetStoreId": "",
"name": "BitmapLabel",
"type": "BitmapText::BitmapTextObject",
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 4,
"topEdgeAnchor": 4,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "BitmapTextStyleState",
"type": "PanelSpriteButton::BitmapTextStyleState",
"HoverColor": "",
"HoverPrefix": "",
"HoverSuffix": "",
"IsHovered": false,
"IdleText": "",
"IdleColor": ""
}
],
"content": {
"text": "Text",
"opacity": 255,
"scale": 1,
"fontSize": 20,
"tint": "255;255;255",
"bitmapFontResourceName": "",
"textureAtlasResourceName": "",
"align": "center",
"verticalTextAlignment": "center"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "Label"
},
{
"objectName": "BitmapLabel"
},
{
"objectName": "Idle"
},
{
"objectName": "Hovered"
},
{
"objectName": "Pressed"
}
]
},
"objectsGroups": [
{
"name": "Background",
"objects": [
{
"name": "Idle"
},
{
"name": "Hovered"
},
{
"name": "Pressed"
}
]
},
{
"name": "Labels",
"objects": [
{
"name": "Label"
},
{
"name": "BitmapLabel"
}
]
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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": [
{
"angle": 0,
"customSize": true,
"depth": 1,
"height": 64,
"layer": "",
"name": "Idle",
"persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6",
"width": 256,
"x": 0,
"y": 0,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": true,
"depth": 1,
"height": 64,
"layer": "",
"name": "Label",
"persistentUuid": "3b29c95c-5363-4e25-bf47-eecf13e8a226",
"width": 256,
"x": 0,
"y": 32,
"zOrder": 2,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"editionSettings": {
"grid": false,
"gridType": "rectangular",
"gridWidth": 32,
"gridHeight": 32,
"gridDepth": 32,
"gridOffsetX": 0,
"gridOffsetY": 0,
"gridOffsetZ": 0,
"gridColor": 10401023,
"gridAlpha": 0.8,
"snap": false,
"zoomFactor": 2.734375,
"windowMask": false,
"selectedLayer": "",
"gameEditorMode": "instances-editor"
},
"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.\nOnly the instance for the current state is shown."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "Create"
},
"parameters": [
"",
"Hovered",
"0",
"0",
""
]
},
{
"type": {
"value": "Create"
},
"parameters": [
"",
"Pressed",
"0",
"0",
""
]
},
{
"type": {
"value": "ResizableCapability::ResizableBehavior::SetSize"
},
"parameters": [
"Hovered",
"Resizable",
"Idle.Width()",
"Idle.Height()"
]
},
{
"type": {
"value": "ResizableCapability::ResizableBehavior::SetSize"
},
"parameters": [
"Pressed",
"Resizable",
"Idle.Width()",
"Idle.Height()"
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Hovered"
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Pressed"
]
},
{
"type": {
"value": "SetZOrder"
},
"parameters": [
"Hovered",
"=",
"1"
]
},
{
"type": {
"value": "SetZOrder"
},
"parameters": [
"Pressed",
"=",
"1"
]
},
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"Labels",
"Text",
"=",
"LabelText"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"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": "PanelSpriteButton::PanelSpriteButton::IsPressed"
},
"parameters": [
"Object",
""
]
}
],
"actions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset"
},
"parameters": [
"Object",
"=",
"PressedLabelOffsetY",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"Labels",
"Text",
"=",
"LabelText"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "Action",
"name": "doStepPostEvents",
"sentence": "",
"events": [
{
"colorB": 228,
"colorG": 176,
"colorR": 74,
"creationTime": 0,
"name": "Apply states",
"source": "",
"type": "BuiltinCommonInstructions::Group",
"events": [
{
"type": "BuiltinCommonInstructions::Comment",
"color": {
"b": 109,
"g": 230,
"r": 255,
"textB": 0,
"textG": 0,
"textR": 0
},
"comment": "Show the right background accordingly to the new state."
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsIdle"
},
"parameters": [
"Object",
"ButtonFSM"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "PanelSpriteButton::TextStyleState::SetIsHovered"
},
"parameters": [
"Label",
"TextStyleState",
"no",
""
]
},
{
"type": {
"value": "PanelSpriteButton::BitmapTextStyleState::SetIsHovered"
},
"parameters": [
"BitmapLabel",
"BitmapTextStyleState",
"no",
""
]
},
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset"
},
"parameters": [
"Object",
"=",
"0",
""
]
},
{
"type": {
"value": "Show"
},
"parameters": [
"Idle",
""
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Pressed"
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "Visible"
},
"parameters": [
"Hovered"
]
},
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"HoveredFadeOutDuration",
">",
"0"
]
}
],
"actions": [
{
"type": {
"value": "Tween::TweenBehavior::AddObjectOpacityTween2"
},
"parameters": [
"Hovered",
"Tween",
"\"Fadeout\"",
"0",
"\"linear\"",
"HoveredFadeOutDuration",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"HoveredFadeOutDuration",
"=",
"0"
]
}
],
"actions": [
{
"type": {
"value": "Hide"
},
"parameters": [
"Hovered"
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "OpacityCapability::OpacityBehavior::Value"
},
"parameters": [
"Hovered",
"Opacity",
"=",
"0"
]
}
],
"actions": [
{
"type": {
"value": "Hide"
},
"parameters": [
"Hovered"
]
},
{
"type": {
"value": "OpacityCapability::OpacityBehavior::SetValue"
},
"parameters": [
"Hovered",
"Opacity",
"=",
"255"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsHovered"
},
"parameters": [
"Object",
"ButtonFSM"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "PanelSpriteButton::TextStyleState::SetIsHovered"
},
"parameters": [
"Label",
"TextStyleState",
"",
""
]
},
{
"type": {
"value": "PanelSpriteButton::BitmapTextStyleState::SetIsHovered"
},
"parameters": [
"BitmapLabel",
"BitmapTextStyleState",
"yes",
""
]
},
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset"
},
"parameters": [
"Object",
"=",
"0",
""
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Idle"
]
},
{
"type": {
"value": "Show"
},
"parameters": [
"Hovered",
""
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Pressed"
]
}
],
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "NumberVariable"
},
"parameters": [
"HoveredFadeOutDuration",
">",
"0"
]
}
],
"actions": [
{
"type": {
"value": "Tween::RemoveTween"
},
"parameters": [
"Hovered",
"Tween",
"\"Fadeout\""
]
},
{
"type": {
"value": "OpacityCapability::OpacityBehavior::SetValue"
},
"parameters": [
"Hovered",
"Opacity",
"=",
"255"
]
}
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsPressed"
},
"parameters": [
"Object",
"ButtonFSM"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "PanelSpriteButton::TextStyleState::SetIsHovered"
},
"parameters": [
"Label",
"TextStyleState",
"no",
""
]
},
{
"type": {
"value": "PanelSpriteButton::BitmapTextStyleState::SetIsHovered"
},
"parameters": [
"BitmapLabel",
"BitmapTextStyleState",
"no",
""
]
},
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset"
},
"parameters": [
"Object",
"=",
"PressedLabelOffsetY",
""
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Idle"
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Hovered"
]
},
{
"type": {
"value": "Show"
},
"parameters": [
"Pressed",
""
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::IsFocused"
},
"parameters": [
"Object",
"ButtonFSM"
]
},
{
"type": {
"value": "BuiltinCommonInstructions::Once"
},
"parameters": []
}
],
"actions": [
{
"type": {
"value": "PanelSpriteButton::TextStyleState::SetIsHovered"
},
"parameters": [
"Label",
"TextStyleState",
"yes",
""
]
},
{
"type": {
"value": "PanelSpriteButton::BitmapTextStyleState::SetIsHovered"
},
"parameters": [
"BitmapLabel",
"BitmapTextStyleState",
"yes",
""
]
},
{
"type": {
"value": "PanelSpriteButton::PanelSpriteButton::SetLabelOffset"
},
"parameters": [
"Object",
"=",
"0",
""
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Idle"
]
},
{
"type": {
"value": "Show"
},
"parameters": [
"Hovered",
""
]
},
{
"type": {
"value": "Hide"
},
"parameters": [
"Pressed"
]
}
]
}
],
"parameters": []
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"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": "PanelSpriteButton::ButtonFSM::IsIdle"
},
"parameters": [
"Idle",
"ButtonFSM",
""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"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": "PanelSpriteButton::ButtonFSM::IsClicked"
},
"parameters": [
"Idle",
"ButtonFSM",
""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"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": "PanelSpriteButton::ButtonFSM::IsHovered"
},
"parameters": [
"Idle",
"ButtonFSM",
""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"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": "PanelSpriteButton::ButtonFSM::IsFocused"
},
"parameters": [
"Idle",
"ButtonFSM",
""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"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": "PanelSpriteButton::ButtonFSM::IsPressed"
},
"parameters": [
"Idle",
"ButtonFSM",
""
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"objectGroups": []
},
{
"description": "Change the text of the button label.",
"fullName": "Label text",
"functionType": "Action",
"name": "SetLabelText",
"private": true,
"sentence": "Change the text of _PARAM0_ to _PARAM1_",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"Labels",
"Text",
"=",
"Value"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
},
{
"description": "Text",
"name": "Value",
"type": "string"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "ActionWithOperator",
"getterName": "LabelText",
"name": "SetLabelTextOp",
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "TextContainerCapability::TextContainerBehavior::SetValue"
},
"parameters": [
"Labels",
"Text",
"=",
"Value"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"objectGroups": []
},
{
"description": "the label text.",
"fullName": "Label text",
"functionType": "ExpressionAndCondition",
"name": "LabelText",
"sentence": "the label text",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetReturnString"
},
"parameters": [
"Labels.Text::Value()"
]
}
]
}
],
"expressionType": {
"type": "string"
},
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"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": "BooleanVariable"
},
"parameters": [
"ShouldActivate",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "ActivateBehavior"
},
"parameters": [
"Idle",
"ButtonFSM",
"yes"
]
}
]
},
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [
{
"type": {
"inverted": true,
"value": "BooleanVariable"
},
"parameters": [
"ShouldActivate",
"True",
""
]
}
],
"actions": [
{
"type": {
"value": "ActivateBehavior"
},
"parameters": [
"Idle",
"ButtonFSM",
"no"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"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": [
"Idle",
"ButtonFSM"
]
}
],
"actions": [
{
"type": {
"value": "SetReturnBoolean"
},
"parameters": [
"True"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"objectGroups": []
},
{
"description": "the labelOffset of the object.",
"fullName": "LabelOffset",
"functionType": "ExpressionAndCondition",
"name": "LabelOffset",
"private": true,
"sentence": "the labelOffset",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetReturnNumber"
},
"parameters": [
"LabelOffset"
]
}
]
}
],
"expressionType": {
"type": "expression"
},
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"objectGroups": []
},
{
"fullName": "",
"functionType": "ActionWithOperator",
"getterName": "LabelOffset",
"name": "SetLabelOffset",
"private": true,
"sentence": "",
"events": [
{
"type": "BuiltinCommonInstructions::Standard",
"conditions": [],
"actions": [
{
"type": {
"value": "SetCenterY"
},
"parameters": [
"Labels",
"+",
"Value - LabelOffset"
]
},
{
"type": {
"value": "SetNumberVariable"
},
"parameters": [
"LabelOffset",
"=",
"Value"
]
}
]
}
],
"parameters": [
{
"description": "Object",
"name": "Object",
"supplementaryInformation": "PanelSpriteButton::PanelSpriteButton",
"type": "object"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "onCreated"
},
{
"functionName": "onHotReloading"
},
{
"functionName": "doStepPostEvents"
},
{
"functionName": "IsIdle"
},
{
"functionName": "IsClicked"
},
{
"functionName": "IsHovered"
},
{
"functionName": "IsFocused"
},
{
"functionName": "IsPressed"
},
{
"functionName": "SetLabelText"
},
{
"functionName": "SetLabelTextOp"
},
{
"functionName": "LabelText"
},
{
"functionName": "Activate"
},
{
"functionName": "IsActivated"
},
{
"functionName": "LabelOffset"
},
{
"functionName": "SetLabelOffset"
}
]
},
"propertyDescriptors": [
{
"value": "",
"type": "MultilineString",
"label": "Label",
"name": "LabelText"
},
{
"value": "0.25",
"type": "Number",
"unit": "Second",
"label": "Hovered fade out duration",
"group": "States",
"name": "HoveredFadeOutDuration"
},
{
"value": "0",
"type": "Number",
"unit": "Pixel",
"label": "Label offset on Y axis when pressed",
"group": "States",
"name": "PressedLabelOffsetY"
},
{
"value": "0",
"type": "Number",
"unit": "Pixel",
"label": "",
"group": "States",
"hidden": true,
"name": "LabelOffset"
},
{
"value": "",
"type": "Choice",
"label": "",
"choices": [
{
"label": "Label.Text=LabelText",
"value": "Label.Text=LabelText"
},
{
"label": "BitmapLabel.Text=LabelText",
"value": "BitmapLabel.Text=LabelText"
}
],
"hidden": true,
"name": "_PropertyMapping"
}
],
"propertiesFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"propertyName": "LabelText"
},
{
"propertyName": "_PropertyMapping"
},
{
"folderName": "States",
"children": [
{
"propertyName": "HoveredFadeOutDuration"
},
{
"propertyName": "PressedLabelOffsetY"
},
{
"propertyName": "LabelOffset"
}
]
}
]
},
"variants": [
{
"areaMaxX": 128,
"areaMaxY": 48,
"areaMaxZ": 64,
"areaMinX": 0,
"areaMinY": 0,
"areaMinZ": 0,
"assetStoreAssetId": "80b9ddd78c8727888bb53c7524f443682746667b1ba493c223114c04e7661bbf",
"assetStoreOriginalName": "Small Blue Button",
"name": "Small Blue Button",
"objects": [
{
"assetStoreId": "",
"bold": false,
"italic": false,
"name": "Label",
"smoothed": true,
"type": "TextObject::Text",
"underlined": false,
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 4,
"topEdgeAnchor": 4,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "TextStyleState",
"type": "PanelSpriteButton::TextStyleState",
"ShouldEnableOutlineOnHover": false,
"HoverColor": "",
"ShouldEnableShadowOnHover": false,
"HoverFontSize": 0,
"IsHovered": false,
"IdleFontSize": 0,
"IdleColor": ""
}
],
"string": "Text",
"font": "",
"textAlignment": "center",
"characterSize": 20,
"color": {
"b": 0,
"g": 0,
"r": 0
},
"content": {
"bold": false,
"isOutlineEnabled": false,
"isShadowEnabled": false,
"italic": false,
"outlineColor": "255;255;255",
"outlineThickness": 2,
"shadowAngle": 90,
"shadowBlurRadius": 2,
"shadowColor": "0;0;0",
"shadowDistance": 4,
"shadowOpacity": 127,
"smoothed": true,
"underlined": false,
"text": "Text",
"font": "",
"textAlignment": "center",
"verticalTextAlignment": "center",
"characterSize": 20,
"lineHeight": 0,
"color": "0;0;0"
}
},
{
"assetStoreId": "",
"bottomMargin": 5,
"height": 32,
"leftMargin": 3,
"name": "Idle",
"rightMargin": 3,
"texture": "assets\\Small Blue Button_Idle.png",
"tiled": false,
"topMargin": 3,
"type": "PanelSpriteObject::PanelSprite",
"width": 32,
"variables": [
{
"folded": true,
"name": "State",
"type": "string",
"value": "Idle"
}
],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 2,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"topEdgeAnchor": 1,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "ButtonFSM",
"type": "PanelSpriteButton::ButtonFSM",
"ShouldCheckHovering": true
}
]
},
{
"assetStoreId": "",
"bottomMargin": 5,
"height": 32,
"leftMargin": 3,
"name": "Hovered",
"rightMargin": 3,
"texture": "assets\\Small Blue Button_Hovered.png",
"tiled": false,
"topMargin": 3,
"type": "PanelSpriteObject::PanelSprite",
"width": 32,
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 2,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"topEdgeAnchor": 1,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "Tween",
"type": "Tween::TweenBehavior"
}
]
},
{
"assetStoreId": "",
"bottomMargin": 3,
"height": 32,
"leftMargin": 3,
"name": "Pressed",
"rightMargin": 3,
"texture": "assets\\Small Blue Button_Pressed.png",
"tiled": false,
"topMargin": 3,
"type": "PanelSpriteObject::PanelSprite",
"width": 32,
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 2,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"topEdgeAnchor": 1,
"useLegacyBottomAndRightAnchors": false
}
]
},
{
"assetStoreId": "",
"name": "BitmapLabel",
"type": "BitmapText::BitmapTextObject",
"variables": [],
"effects": [],
"behaviors": [
{
"name": "Anchor",
"type": "AnchorBehavior::AnchorBehavior",
"bottomEdgeAnchor": 4,
"topEdgeAnchor": 4,
"leftEdgeAnchor": 1,
"relativeToOriginalWindowSize": true,
"rightEdgeAnchor": 2,
"useLegacyBottomAndRightAnchors": false
},
{
"name": "BitmapTextStyleState",
"type": "PanelSpriteButton::BitmapTextStyleState",
"HoverColor": "",
"HoverPrefix": "",
"HoverSuffix": "",
"IsHovered": false,
"IdleText": "",
"IdleColor": ""
}
],
"content": {
"text": "Button",
"opacity": 255,
"scale": 1,
"fontSize": 20,
"tint": "255;255;255",
"bitmapFontResourceName": "assets\\8BitOperatorPlus8Regular_Edited.fnt",
"textureAtlasResourceName": "assets\\8BitOperatorPlus8Regular_Edited.png",
"align": "center",
"verticalTextAlignment": "center"
}
}
],
"objectsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"objectName": "Label"
},
{
"objectName": "BitmapLabel"
},
{
"objectName": "Idle"
},
{
"objectName": "Hovered"
},
{
"objectName": "Pressed"
}
]
},
"objectsGroups": [
{
"name": "Background",
"objects": [
{
"name": "Idle"
},
{
"name": "Hovered"
},
{
"name": "Pressed"
}
]
},
{
"name": "Labels",
"objects": [
{
"name": "Label"
},
{
"name": "BitmapLabel"
}
]
}
],
"layers": [
{
"ambientLightColorB": 200,
"ambientLightColorG": 200,
"ambientLightColorR": 200,
"camera2DPlaneMaxDrawingDistance": 5000,
"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": [
{
"angle": 0,
"customSize": true,
"depth": 1,
"height": 48,
"layer": "",
"name": "Idle",
"persistentUuid": "24882334-eec8-403e-8bf1-70fc928a46e6",
"width": 128,
"x": 0,
"y": 0,
"zOrder": 1,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
},
{
"angle": 0,
"customSize": true,
"depth": 1,
"height": 48,
"keepRatio": true,
"layer": "",
"name": "BitmapLabel",
"persistentUuid": "c3c3200d-dec4-4ac4-9dc5-4715d8989830",
"width": 128,
"x": 5,
"y": 26,
"zOrder": 2,
"numberProperties": [],
"stringProperties": [],
"initialVariables": []
}
],
"editionSettings": []
}
]
}
]
},
{
"author": "",
"category": "General",
"dimension": "",
"extensionNamespace": "",
"fullName": "JSON Resource Loading",
"gdevelopVersion": ">=5.5.222",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWZpbGUtY29kZS1vdXRsaW5lIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTE0IDJINkM0Ljg5IDIgNCAyLjkgNCA0VjIwQzQgMjEuMTEgNC44OSAyMiA2IDIySDE4QzE5LjExIDIyIDIwIDIxLjExIDIwIDIwVjhMMTQgMk0xOCAyMEg2VjRIMTNWOUgxOFYyME05LjU0IDE1LjY1TDExLjYzIDE3Ljc0TDEwLjM1IDE5TDcgMTUuNjVMMTAuMzUgMTIuM0wxMS42MyAxMy41Nkw5LjU0IDE1LjY1TTE3IDE1LjY1TDEzLjY1IDE5TDEyLjM4IDE3Ljc0TDE0LjQ3IDE1LjY1TDEyLjM4IDEzLjU2TDEzLjY1IDEyLjNMMTcgMTUuNjVaIiAvPjwvc3ZnPg==",
"name": "JSONResourceLoader",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/file-code-outline.svg",
"shortDescription": "Loads a JSON resource into a variable.",
"version": "1.1.0",
"description": [
"Loads a (static) JSON resource from your project files into a global, scene, or object variable.",
"",
"NEVER use this to load your game.json into a variable - this would increase your game size by a lot and make your whole project file available for anyone to open!"
],
"origin": {
"identifier": "JSONResourceLoader",
"name": "gdevelop-extension-store"
},
"tags": [
"json",
"resource",
"load",
"open",
"file",
"data",
"static",
"file"
],
"authorIds": [
"ZgrsWuRTAkXgeuPV9bo0zuEcA2w1"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Loads a JSON resource into a scene structure variable.",
"fullName": "Load a JSON resource in a scene variable",
"functionType": "Action",
"name": "LoadJSONToScene",
"private": true,
"sentence": "Load _PARAM1_ into scene variable _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"eventsFunctionContext",
" .getArgument(\"Variable\")",
" .fromJSObject(",
" runtimeScene",
" .getGame()",
" .getJsonManager()",
" .getLoadedJson(eventsFunctionContext.getArgument(\"Resource\"))",
" );",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The resource to load the JSON from",
"name": "Resource",
"type": "jsonResource"
},
{
"description": "The scene variable to load the JSON to",
"name": "Variable",
"type": "scenevar"
}
],
"objectGroups": []
},
{
"description": "Loads a JSON resource into a global structure variable.",
"fullName": "Load a JSON resource in a global variable",
"functionType": "Action",
"name": "LoadJSONToGlobal",
"private": true,
"sentence": "Load _PARAM1_ into global variable _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"eventsFunctionContext",
" .getArgument(\"Variable\")",
" .fromJSObject(",
" runtimeScene",
" .getGame()",
" .getJsonManager()",
" .getLoadedJson(eventsFunctionContext.getArgument(\"Resource\"))",
" );",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The resource to load the JSON from",
"name": "Resource",
"type": "jsonResource"
},
{
"description": "The global variable to load the JSON to",
"name": "Variable",
"type": "globalvar"
}
],
"objectGroups": []
},
{
"description": "Loads a JSON resource into an object structure variable.",
"fullName": "Load a JSON resource in an object variable",
"functionType": "Action",
"name": "LoadJSONToObject",
"sentence": "Load _PARAM1_ into object variable _PARAM3_ of object _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"eventsFunctionContext",
" .getArgument(\"Variable\")",
" .fromJSObject(",
" runtimeScene",
" .getGame()",
" .getJsonManager()",
" .getLoadedJson(eventsFunctionContext.getArgument(\"Resource\"))",
" );",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": false
}
],
"parameters": [
{
"description": "The resource to load the JSON from",
"name": "Resource",
"type": "jsonResource"
},
{
"description": "The object where to find the variable",
"name": "Object",
"type": "objectList"
},
{
"description": "The object variable to load the JSON to",
"name": "Variable",
"type": "objectvar"
}
],
"objectGroups": []
},
{
"description": "Loads a JSON resource into a structure variable.",
"fullName": "Load a JSON resource in a variable",
"functionType": "Action",
"name": "LoadJSONToVariable",
"sentence": "Load _PARAM1_ into variable _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"/** @type {gdjs.Variable} */",
"//@ts-ignore",
"const variable = eventsFunctionContext.getArgument(\"Variable\");",
"variable.fromJSObject(",
" runtimeScene",
" .getGame()",
" .getJsonManager()",
" .getLoadedJson(eventsFunctionContext.getArgument(\"Resource\"))",
");",
""
],
"parameterObjects": "",
"useStrict": true,
"eventsSheetExpanded": true
}
],
"parameters": [
{
"description": "The resource to load the JSON from",
"name": "Resource",
"type": "jsonResource"
},
{
"description": "The variable to load the JSON to",
"name": "Variable",
"type": "variable"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "LoadJSONToVariable"
},
{
"functionName": "LoadJSONToScene"
},
{
"functionName": "LoadJSONToGlobal"
},
{
"functionName": "LoadJSONToObject"
}
]
},
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
},
{
"author": "@Bouh",
"category": "User interface",
"dimension": "",
"extensionNamespace": "",
"fullName": "Time formatting",
"gdevelopVersion": ">=5.5.222",
"helpPath": "",
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0ibWRpLWNsb2NrLWRpZ2l0YWwiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMiw2QTIsMiAwIDAsMCAwLDhWMTZBMiwyIDAgMCwwIDIsMThIMjJBMiwyIDAgMCwwIDI0LDE2VjhBMiwyIDAgMCwwIDIyLDZNMiw4SDIyVjE2SDJNMyw5VjEwLjVINi4yNUwzLDE1SDQuNzVMOCwxMC41VjlNOS4yNSw5VjEwLjVIMTAuNzVWOU0xMiw5VjEwLjVIMTMuNVYxNUgxNVY5TTE3LDlBMSwxIDAgMCwwIDE2LDEwVjE0QTEsMSAwIDAsMCAxNywxNUgyMEExLDEgMCAwLDAgMjEsMTRWMTBBMSwxIDAgMCwwIDIwLDlNMTcuNSwxMC41SDE5LjVWMTMuNUgxNy41TTkuMjUsMTMuNVYxNUgxMC43NVYxMy41IiAvPjwvc3ZnPg==",
"name": "TimeFormatter",
"previewIconUrl": "https://resources.gdevelop-app.com/assets/Icons/clock-digital.svg",
"shortDescription": "Format seconds into HH:MM:SS or HH:MM:SS.000 time display strings.",
"version": "0.0.2",
"description": [
"Ideal for displaying timers on screen.",
"",
"Formats included:",
"* HH:MM:SS",
"* HH:MM:SS.000 (displays milliseconds)"
],
"origin": {
"identifier": "TimeFormatter",
"name": "gdevelop-extension-store"
},
"tags": [
"time",
"timer",
"format",
"hours",
"minutes",
"seconds",
"milliseconds"
],
"authorIds": [
"2OwwM8ToR9dx9RJ2sAKTcrLmCB92"
],
"dependencies": [],
"globalVariables": [],
"sceneVariables": [],
"eventsFunctions": [
{
"description": "Format time in seconds to HH:MM:SS.",
"fullName": "Format time in seconds to HH:MM:SS",
"functionType": "StringExpression",
"name": "SecondsToHHMMSS",
"sentence": "Format time _PARAM1_ to HH:MM:SS in _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"var format_time = function (time_second) {\r",
" date = new Date(null);\r",
" date.setSeconds(time_second);\r",
" if (time_second >= 3600) {\r",
" return date.toISOString().substr(11, 8); // MM:SS\r",
" } else {\r",
" return date.toISOString().substr(14, 5); // HH:MM:SS\r",
" }\r",
"}\r",
"\r",
"eventsFunctionContext.returnValue = format_time(eventsFunctionContext.getArgument(\"TimeInSeconds\"));"
],
"parameterObjects": "",
"useStrict": false,
"eventsSheetExpanded": false
}
],
"expressionType": {
"type": "string"
},
"parameters": [
{
"description": "Time, in seconds",
"name": "TimeInSeconds",
"type": "expression"
}
],
"objectGroups": []
},
{
"description": "Format time in seconds to HH:MM:SS.000, including milliseconds.",
"fullName": "Format time in seconds to HH:MM:SS.000",
"functionType": "StringExpression",
"name": "SecondsToHHMMSS000",
"sentence": "Format time _PARAM1_ to HH:MM:SS in _PARAM2_",
"events": [
{
"type": "BuiltinCommonInstructions::JsCode",
"inlineCode": [
"var format_time = function (time_second) {\r",
" date = new Date(null);\r",
" date.setMilliseconds(1000*time_second);\r",
" if (time_second >= 3600) {\r",
" return date.toISOString().substr(11, 12); // MM:SS.000\r",
" } else {\r",
" return date.toISOString().substr(14, 9); // HH:MM:SS.000\r",
" }\r",
"}\r",
"\r",
"eventsFunctionContext.returnValue = format_time(eventsFunctionContext.getArgument(\"TimeInSeconds\"));"
],
"parameterObjects": "",
"useStrict": false,
"eventsSheetExpanded": false
}
],
"expressionType": {
"type": "string"
},
"parameters": [
{
"description": "Time, in seconds",
"name": "TimeInSeconds",
"type": "expression"
}
],
"objectGroups": []
}
],
"eventsFunctionsFolderStructure": {
"folderName": "__ROOT",
"children": [
{
"functionName": "SecondsToHHMMSS"
},
{
"functionName": "SecondsToHHMMSS000"
}
]
},
"eventsBasedBehaviors": [],
"eventsBasedObjects": []
}
],
"externalLayouts": []
}