Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Is there any way to copy data to clipboard in CC exe builds?

srfstudio
Registered User
Quote
2018-09-02 20:26:28

Does anyone knows if there is a way to send (copy)/ recieve from clipboard data in Copper Cube exe build?

If I could manage to send out variable (simple integer/number) from CC exe build to clipboard I will have everything I need for a desktop game setup and not just WebGL/html5.


My html5 game setup is:

1. Primary app (usually Construct 2) that iFrames things it can't produce (like: 3D levels, 360 videos, etc.).
2. Secondary apps ( 3D levels, 360 videos, Twine dialogs, etc.)

The communication between primary & secondary files is done by JavaScript Local Variables.

This setup is also doable with Construct 2 & Windows apps but, in that case, communication with Local Variables is not possible.

If Construct 2 is to 'iFrame' Windows apps ( run them in-front of master-canvas) the only possible ways of communicating is by:

1. Clipboard
2. Reading/Writting txt files
3. Ajax

Clipboard would be easiest solution if it's possible :)

This is my CCB example file...
https://www.newgrounds.com/dump/...

...in it I have placed two objects, first is successfully sending/copying data to Clipboard in WebGL builds and the second one should do the same for exe builds but I don't know how to make it work :(

If anyone has any idea on how this could be achieved I would really appreciate it.


srfstudio
Registered User
Quote
2018-09-02 23:03:37

Just to say that I've done some tests and solved the problem by using text files :)

The JavaScript references ccbReadFileContent & ccbWriteFileContent was all I needed and they worked out great!

The communication between Cooper Cube and Construct 2 goes two-ways almost in the same way. The only difference is that I have to use Ajax object in Construct 2 in order to read txt file and place it's value in a variable. It's much easier with Cooper Cube, I just place var xyz = ccbReadFileContent and it works :)

Sorry for my stupid-posting in forum, cheers!


just_in_case
Moderator
Quote
2018-09-03 12:14:48

there is an action created by me to read specific line from a text file is available on ambiera's extensions download page. you can also use that...


srfstudio
Registered User
Quote
2018-09-04 19:12:40

That could be extremely useful in my situation, I will check it out. Thank you for creating such a useful extension, cheers!


srfstudio
Registered User
Quote
2018-09-05 21:56:25

Unfortunately Read Specific Line action is functioning only in exe exports, not in WebGL, bumer


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact