No worries Bouh…
I think I’ll just share what I’m trying here… it might make it easier for somebody to help…
So I made a simple GDevelop File with 2 scenes - each scene having a text-sprite. Clicking/tapping the text sprite in the first scene takes you to the second scene and clicking/tapping the text-sprite on the second scene takes you to the first.
My aim: When going from scene 1 to scene 2 activate screen-pinning and deactivate it when going back.
As mentioned, the plugin I’m trying to incorporate - https://github.com/fedme/cordova-plugin-screen-pinning
I export the file using the ‘Manual’ option into a separate folder.
In the folder there is:
- a folder named www
- a file called config
I then build the app using build.phonegap.com, and check it on the phone. It works. It goes from one screen to another and back to the first screen on tapping the respective text.
Then in the node.js command prompt, while inside the project folder, I type the command
: cordova plugin add cordova-plugin-screen-pinning.
Now in the folder there is:
- a folder named node_modules
- a folder named plugins
- a folder named www
- a file named config
- a JSON file named package-lock
Then going through files in folder www, I realise that files code0 and code1 are linked to scene 1 and scene 2… And going through all the code (in notepad, most of which I don’t understand), I decide to replace - in the code0 file
if (gdjs.Scene1Code.condition1IsTrue_0.val)
{{
gdjs.evtTools.runtimeScene.replaceScene(runtimeScene, “Scene2”, true);
}}
with
if (gdjs.Scene1Code.condition1IsTrue_0.val)
{{
cordova.plugins.screenPinning.enterPinnedMode(
function () {
console.log(“Pinned mode activated!”);
},
function (errorMessage) {
console.log(“Error activating pinned mode:”, errorMessage);
}
);
gdjs.evtTools.runtimeScene.replaceScene(runtimeScene, “Scene2”, true);
}}
and similarly in code1 file, I add the example code provided for deactivating screen-plugin.
I then, once again build the file using the online build service and install the app on my phone. But now tapping the text on screen does nothing. The screen is neither pinned, nor does the scene change.
I know what I’m doing is probably rubbish… But please be patient with me… Somebody help… If it’s not too much to ask for @4ian - can you lend a hand…
Regards,
Dan