diff --git a/extensions/community/ScreenOrientation.json b/extensions/community/ScreenOrientation.json new file mode 100644 index 000000000..a84d54048 --- /dev/null +++ b/extensions/community/ScreenOrientation.json @@ -0,0 +1,434 @@ +{ + "author": "", + "category": "Game mechanic", + "extensionNamespace": "", + "fullName": "Screen Orientation", + "gdevelopVersion": "", + "helpPath": "", + "iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDpub25lO3N0cm9rZTojMDAwMDAwO3N0cm9rZS13aWR0aDoyO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDt9DQo8L3N0eWxlPg0KPHBhdGggZD0iTTI3LDE0SDVjLTAuNCwwLTAuNywwLjEtMSwwLjJWOGgxMnY0YzAsMC42LDAuNCwxLDEsMXMxLTAuNCwxLTFWNWMwLTEuNy0xLjMtMy0zLTNINUMzLjMsMiwyLDMuMywyLDV2MTJ2MTANCgljMCwxLjcsMS4zLDMsMywzaDIyYzEuNywwLDMtMS4zLDMtM1YxN0MzMCwxNS4zLDI4LjcsMTQsMjcsMTR6IE03LDIzYzAsMC42LTAuNCwxLTEsMXMtMS0wLjQtMS0xdi0yYzAtMC42LDAuNC0xLDEtMXMxLDAuNCwxLDFWMjN6DQoJIE0yNCwyOEgxMFYxNmgxNFYyOHoiLz4NCjxwYXRoIGQ9Ik0xOS45LDUuMUMyMi44LDUuNSwyNSw4LDI1LDExYzAsMC40LDAuMywwLjgsMC43LDAuOWMwLjEsMCwwLjIsMC4xLDAuMywwLjFjMC4zLDAsMC42LTAuMSwwLjgtMC40bDMtNA0KCWMwLjMtMC40LDAuMi0xLjEtMC4yLTEuNGMtMC40LTAuMy0xLjEtMC4yLTEuNCwwLjJsLTEuNiwyLjFjLTAuOS0yLjgtMy40LTUtNi40LTUuNEMxOS42LDMsMTkuMSwzLjQsMTksMy45QzE5LDQuNSwxOS4zLDUsMTkuOSw1LjENCgl6Ii8+DQo8L3N2Zz4NCg==", + "name": "ScreenOrientation", + "previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Computers and Hardware/3b0c6e05075b0db18a2931d72d18e8aff2c613106b66af9d60717a308c0122ad_Computers and Hardware_phone_rotate_rotation_arrow.svg", + "shortDescription": "Screen Orientation\nUsed to force landscape, portrait or both.", + "version": "1.1.0", + "description": [ + "Version 1.0.0", + "Version 1.0.1 - Bug Fixes", + "Version 1.1.0 - Added Features", + "Verison 1.1.1 - Extension Improvements" + ], + "tags": [ + "Orientation" + ], + "authorIds": [ + "mu1pKMrGmTTX98LMxHYJ62GzFyJ2" + ], + "dependencies": [], + "globalVariables": [ + { + "name": "CurrentOrientation", + "type": "string", + "value": "0" + } + ], + "sceneVariables": [], + "eventsFunctions": [ + { + "description": "Screen Orientation \"Landscape, Portrait Or Both\").", + "fullName": "Screen Orientation", + "functionType": "Action", + "name": "ScreenOrientation", + "sentence": "_PARAM1_", + "events": [ + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "ScreenOrientation", + "=", + "\"Portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetFullScreen" + }, + "parameters": [ + "", + "yes", + "yes" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "CurrentOrientation", + "=", + "\"Portrait\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": " screen.orientation.lock('portrait');", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "ScreenOrientation", + "=", + "\"Landscape \"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetFullScreen" + }, + "parameters": [ + "", + "yes", + "yes" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "CurrentOrientation", + "=", + "\"Landscape\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": " screen.orientation.lock('landscape');", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ] + }, + { + "folded": true, + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "ScreenOrientation", + "=", + "\"Both\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetFullScreen" + }, + "parameters": [ + "", + "yes", + "yes" + ] + }, + { + "type": { + "value": "SetStringVariable" + }, + "parameters": [ + "CurrentOrientation", + "=", + "\"Both\"" + ] + } + ], + "events": [ + { + "type": "BuiltinCommonInstructions::JsCode", + "inlineCode": " screen.orientation.unlock()", + "parameterObjects": "", + "useStrict": true, + "eventsSheetExpanded": false + } + ] + } + ], + "parameters": [ + { + "description": "Screen Orientation", + "name": "ScreenOrientation", + "supplementaryInformation": "[\"Landscape \",\"Portrait\",\"Both\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "If the Orientation Is True.", + "fullName": "If Orientation", + "functionType": "Condition", + "name": "ConditionOrientaion", + "sentence": "_PARAM1_", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Orientation", + "=", + "\"Portrait\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Orientation", + "=", + "CurrentOrientation" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Orientation", + "=", + "\"Landscape\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Orientation", + "=", + "CurrentOrientation" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "Orientation", + "=", + "\"Both\"" + ] + }, + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Orientation", + "=", + "CurrentOrientation" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "True" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "BuiltinCommonInstructions::CompareStrings" + }, + "parameters": [ + "Orientation", + "!=", + "CurrentOrientation" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnBoolean" + }, + "parameters": [ + "False" + ] + } + ] + } + ], + "parameters": [ + { + "description": "If Orientation", + "name": "Orientation", + "supplementaryInformation": "[\"Landscape\",\"Portrait\",\"Both\"]", + "type": "stringWithSelector" + } + ], + "objectGroups": [] + }, + { + "description": "Current Orientation.", + "fullName": "Expression Orientation", + "functionType": "StringExpression", + "name": "ExpressionOrientaion", + "sentence": "", + "events": [ + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "CurrentOrientation", + "=", + "\"Portrait\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"Portrait\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "CurrentOrientation", + "=", + "\"Landscape\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"Landscape\"" + ] + } + ] + }, + { + "type": "BuiltinCommonInstructions::Standard", + "conditions": [ + { + "type": { + "value": "StringVariable" + }, + "parameters": [ + "CurrentOrientation", + "=", + "\"Both\"" + ] + } + ], + "actions": [ + { + "type": { + "value": "SetReturnString" + }, + "parameters": [ + "\"Both\"" + ] + } + ] + } + ], + "expressionType": { + "type": "string" + }, + "parameters": [], + "objectGroups": [] + } + ], + "eventsBasedBehaviors": [], + "eventsBasedObjects": [] +} \ No newline at end of file