• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 In-game "copy" text to paste in another program?

S

SVG

Guest
Pretty easy to understand question, but not sure if it's possible.

I basically want to do the same thing as the clipboard_set_text function.

Currently those clipboard functions are only good for Windows target only. Is it possible to do something similar for HTML5 target?

Note: This game will be played in the web HTML5 target by PC, Mac, Mobile.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Easy way around: get_string with your text as "default" will bring up a prompt box

Hard way around: custom HTML dialog box or restyle the built-in one (get_string_async) till it looks like what you want
 
  • Like
Reactions: SVG
S

SVG

Guest
This really does help, it is a work around! Thank you!

upload_2018-11-5_15-47-18.png

Okay yeah 1st one definitely was quick and easy. They will have to copy it themselves though, which is fine. In the end I would like to have a button that copies the string like Ctrl+C for them, just for ease of use. Makes it even easier and quicker when someone is using their phone.

So real quick where would I look into customizing the built-in one? Maybe just a point in the right direction if it's not too big of a deal, would be greatly appreciated.
 

Attachments

S

SVG

Guest
If nothing else, just how to change the part that says the IP address. If I can at least change that then this will work pretty well for now. (See pic from last post, the "127.0.0.1:51264 says" I would love to change to something else).

If I need to create a new post then I'll do that.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
So real quick where would I look into customizing the built-in one?
By adding a custom index.html template with custom CSS. Check out the built-in one by doing "show source" via browser developer tools.

IP address
When uploaded it will show your website URL. This is a security measure so that iframes (such as ads) can't bait the viewer for their credentials on the containing site.
 
  • Like
Reactions: SVG
S

SVG

Guest
OOOoohh Okay, so nothing to do with GM2, got it! Thanks you, I'll check it out! You rock, thank you!
 
Top