Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Update README to add back Github's syntax highlighting.

cc @jaredly @Schmavery 
Can we make docre parse this (with the space) as well? It's nice to keep syntax highlighting here
  • Loading branch information
bsansouci authored Apr 20, 2018
1 parent 12f2c51 commit cf49e18
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ npm install schmavery/reprocessing
```

### Example
```reason;use(sandbox);canvas
```reason ;use(sandbox);canvas
open Reprocessing;
let setup = (env) => {
Expand Down Expand Up @@ -73,7 +73,7 @@ See also [FlappyBird](https://github.com/Schmavery/FlappyBird) or [2048](https:/
- For state management, we encourage the use of the `state` value that Reprocessing manages for the user. To use this, decide on a datatype representing the state and return the initial value from `setup`. This will be persisted behind the scenes and passed to every callback (such as `draw` and `mouseDown`). Each callback should return the new value of the state (or the old value if it doesn't change).

- There are no built-in variables like `width` and `mouseX`. Instead, these are functions that are called, passing in an environment object that is always provided.
```reason;prefix(1);no-run
```reason ;prefix(1);no-run
open Reprocessing;
let draw = (state, env) => {
let w = Env.width(env);
Expand All @@ -87,7 +87,7 @@ let draw = (state, env) => {

- Points are expressed as tuples. Instead of exposing a `mouseX` and `mouseY`, there is a `mouse`, which is a tuple of x and y values.

```reason;prefix(1);no-run
```reason ;prefix(1);no-run
open Reprocessing;
let draw = (state, env) => {
let (x, y) = Env.mouse(env);
Expand All @@ -102,11 +102,11 @@ The story for using fonts in your Reprocessing app is still under some developme
Check out [font-generator](https://github.com/bsansouci/font-generator) for a tool that can take any truetype or opentype font and output font files that Reprocessing can use.

The assets folder of this repo also has an [example](https://github.com/Schmavery/reprocessing/tree/master/assets/font) of a font that can be copied to your project and used. In order to use a font once you have the files:
```prefix(2);suffix(1);no-run
```reason ;prefix(2);suffix(1);no-run
open Reprocessing;
let fn = (filename, env) => {
let font = Draw.loadFont(~filename, env);
Draw.text(~font, ~body="Test!!!", ~pos=(10, 10), env);
let font = Draw.loadFont(~filename, env);
Draw.text(~font, ~body="Test!!!", ~pos=(10, 10), env);
}
```

Expand Down

1 comment on commit cf49e18

@jaredly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for sure

Please sign in to comment.