diff options
| author | Amir Rajan <[email protected]> | 2020-09-22 06:27:46 -0500 |
|---|---|---|
| committer | Amir Rajan <[email protected]> | 2020-09-22 06:27:46 -0500 |
| commit | 20d5b4057b44ffcf92478b2a8e9476ace2fdc0f5 (patch) | |
| tree | b4742e4f9acfd5400a04f314164812606a71df9f /dragon/runtime_docs.rb | |
| parent | 5b2311900072cfff9582bb0296140cfb354cb911 (diff) | |
| download | dragonruby-game-toolkit-contrib-20d5b4057b44ffcf92478b2a8e9476ace2fdc0f5.tar.gz dragonruby-game-toolkit-contrib-20d5b4057b44ffcf92478b2a8e9476ace2fdc0f5.zip | |
synced with 1.22
Diffstat (limited to 'dragon/runtime_docs.rb')
| -rw-r--r-- | dragon/runtime_docs.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dragon/runtime_docs.rb b/dragon/runtime_docs.rb index 09759b4..50734ce 100644 --- a/dragon/runtime_docs.rb +++ b/dragon/runtime_docs.rb @@ -31,6 +31,23 @@ This function returns the width and height of a string. #+end_src S end + + def docs_write_file + <<-S +* DOCS: ~GTK::Runtime#write_file~ +This function takes in two parameters. The first paramter is the file path and assumes the the game +directory is the root. The second parameter is the string that will be written. The method overwrites whatever +is currently in the file. Use ~GTK::Runtime#append_file~ to append to the file as opposed to overwriting. + +#+begin_src ruby + def tick args + if args.inputs.mouse.click + args.gtk.write_file "last-mouse-click.txt", "Mouse was clicked at \#{args.state.tick_count}." + end + end +#+end_src +S + end end class GTK::Runtime |
