ruffle/web/packages/core
Kamil Jarosz 60ee0379b7 web: Add clipboard modal informing about shortcuts
This modal informs the user that they can use shortcuts
for copy, cut, and paste instead of using the context menu.
This modal is meant to be displayed when the browser
does not support reading the clipboard,
or the user denies permission to the clipboard.
2024-06-19 00:15:07 +02:00
..
src web: Add clipboard modal informing about shortcuts 2024-06-19 00:15:07 +02:00
test web: Fix color parsing test 2024-06-08 08:42:04 +02:00
texts web: Add clipboard modal informing about shortcuts 2024-06-19 00:15:07 +02:00
tools Revert "web: No longer set the `web_sys_unstable_apis` config variable" 2024-06-19 00:15:07 +02:00
.gitignore web: Convert core/tools to typescript 2024-06-12 23:33:01 +02:00
.mocharc.yaml web: Replace ts-node with tsx (mostly) 2024-06-12 23:33:01 +02:00
README.md docs: Update `streamSwfUrl` to `load` 2020-12-07 15:22:51 -08:00
package.json build(deps-dev): bump the npm-minor group in /web with 5 updates 2024-06-17 18:55:14 +02:00
tsconfig.json web: Use TypeScript project references 2023-02-25 02:00:23 +02:00
typedoc.json web/docs: Display enums in source order 2023-04-24 08:49:06 +03:00

README.md

ruffle-core

ruffle-core is the core javascript bindings to the Wasm ruffle-web binary, and contains the actual public API.

Using ruffle-core

For more examples and in-depth documentation on how to use Ruffle on your website, please check out our wiki.

Host Ruffle

The core package is configured for websites that build and bundle their files themselves. Simply add ruffle to an npm package, and use something like Webpack to actually bundle and serve the files.

If you wish to use Ruffle on a website that doesn't use npm, we have a pre-bundled version which we call 'selfhosted'. Please refer to its documentation.

Please note that the .wasm file must be served properly, and some web servers may not do that correctly out of the box. Please see our wiki for instructions on how to configure this, if you encounter a Incorrect response MIME type error.

"Plug and Play"

If you have an existing website with flash content, you can simply include Ruffle as a script and our polyfill magic will replace everything for you. No fuss, no mess.

<script src="path/to/ruffle/ruffle.js"></script>

Javascript API

If you want to control the Ruffle player, you may use our Javascript API.

<script>
    window.RufflePlayer = window.RufflePlayer || {};

    window.addEventListener("DOMContentLoaded", () => {
        let ruffle = window.RufflePlayer.newest();
        let player = ruffle.createPlayer();
        let container = document.getElementById("container");
        container.appendChild(player);
        player.load("movie.swf");
    });
</script>
<script src="path/to/ruffle/ruffle.js"></script>

Building, testing or contributing

Please see the ruffle-web README.