This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:tutorials:display:clipboard [2018/08/28 05:51 (7 years ago)] – created sausage | en:tutorials:display:clipboard [2020/08/31 05:37 (5 years ago)] (current) – ↷ Links adapted because of a move operation sausage | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== The Clipboard ====== | ====== The Clipboard ====== | ||
- | |||
- | <WRAP center round info 90%> | ||
- | This feature will be released in September 2018. | ||
- | </ | ||
Orx now supports clipboards! We can demonstrate this by allowing the user to paste in some text, and have the text replace a text object. First there' | Orx now supports clipboards! We can demonstrate this by allowing the user to paste in some text, and have the text replace a text object. First there' | ||
- | Start by using [[en: | + | Start by using [[en: |
Next, define the Control-V key which is the usual for paste, except in the case of Mac OS X: | Next, define the Control-V key which is the usual for paste, except in the case of Mac OS X: | ||
Line 51: | Line 47: | ||
Compile and run, and you'll have a window with a text object like this: | Compile and run, and you'll have a window with a text object like this: | ||
- | {{ :en:tutorials: | + | {{ tutorials: |
In the Run() function (or an update function), check for the Control and V keys, call a get from the clipboard, and send the output to the text object: | In the Run() function (or an update function), check for the Control and V keys, call a get from the clipboard, and send the output to the text object: | ||
Line 68: | Line 64: | ||
Come back to the Orx game window and press Control-V. The object will take the text from your clipboard. Nice! | Come back to the Orx game window and press Control-V. The object will take the text from your clipboard. Nice! | ||
- | {{ :en:tutorials: | + | {{ tutorials: |
If you attempt copy and paste a file, a bitmap, or any other non-textual information into Orx, the clipboard will contain '' | If you attempt copy and paste a file, a bitmap, or any other non-textual information into Orx, the clipboard will contain '' | ||
Line 96: | Line 92: | ||
Compile and run. Press Control-C to set the clipboard with the "Hello from Orx." text. Now paste into a text editor to get the text from the clipboard: | Compile and run. Press Control-C to set the clipboard with the "Hello from Orx." text. Now paste into a text editor to get the text from the clipboard: | ||
- | {{ :en:tutorials: | + | {{ tutorials: |
- | You can also work with the clipboard in the [[en: | + | You can also work with the clipboard in the [[en: |
'' | '' |