Web
The web is currently the most developed Coracle renderer and is used to generate all the examples on this website.
Getting Started
- Clone the repository
- Open the web project in Jetbrains IDEA
- Open the Coracle.kt file and choose an example drawing to work with:
import examples.basics.HelloCoracleDrawing fun main() { HelloCoracleDrawing() .renderer(WebRenderer("coracle_canvas")) .start() }
- Create a new Gradle debug/run configuration, click Edit configurations... and click the + icon, choose Gradle from the dropdown type list
- In the Name field enter Browser Run and in the Tasks and arguments field enter: browserRun, click OK
- Click the main run icon, or keyboard shortcut (Linux:
ctrl-R
MacOS:⌃R
) to compile the drawing and open in your default browser
Distribute
- Select Build then Build Project
- Once built copy CoracleWeb.js from
/coracle/coracleweb/build/distributions
- Make sure your live canvas name matches the one you used in dev, the default is
coracle_canvas