You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example rendering a hello message to the screen with 3 different fonts loaded in 3 different ways. The first example uses a system default font requiring no loading. The second example uses a font loaded onto the page via an html link tag. The third example uses a font loaded in the preload function.
4
+
5
+
## Bundling the app
6
+
7
+
This example uses [esgleam](https://hexdocs.pm/esgleam/) to bundle the main gleam module for use in a static site.
8
+
9
+
To install esbuild run the following command. You should only need to run it once.
10
+
11
+
```bash
12
+
gleam run -m esgleam/install
13
+
```
14
+
15
+
To bundle the app run the following command after making code changes.
16
+
17
+
```bash
18
+
gleam run -m esgleam/bundle
19
+
```
20
+
21
+
## Serving the app
22
+
23
+
You can use any static site server to host the app but for development you can continue to use esgleam by running
Copy file name to clipboardexpand all lines: gleam.toml
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
name = "p5js_gleam"
2
-
version = "2.0.2"
2
+
version = "2.1.0"
3
3
target = "javascript"
4
4
5
5
description = "A simple game library providing p5.js bindings for Gleam in a functional style to make basic games and animations. Heavily inspired by the Racket library 2htdp/universe"
`/// A binding to the p5.js [\`${name}\`](https://p5js.org/reference/#/p5/${name}) function. Takes a p5 instance and the function's arguments and returns the p5 instance.
107
+
constgleam=(name: string,binding: Binding)=>
108
+
`/// A binding to the p5.js [\`${
109
+
binding.bindingName??name
110
+
}\`](https://p5js.org/reference/#/p5/${
111
+
binding.bindingName??name
112
+
}) function. Takes a p5 instance and the function's arguments and returns the p5 instance.
0 commit comments