expand API in Using SBB in Your Project page.

master
Craig Oates 5 years ago
parent
commit
9035e35dea
  1. 53
      Using-Smouldering-Beach-Ball-in-Your-Project.md

53
Using-Smouldering-Beach-Ball-in-Your-Project.md

@ -46,28 +46,26 @@ Once you have those two lines in the memory bank, you will spend most of your ti
The template is as follows:
- Name
### Name
- Parameters
- Description
- Usage/Examples
- `makeImage`
### `makeImage`
- `(spec: ImageSpec)`
- An asynchronous function which creates an image using the specification provided by the ImageSpec data-type.
```f#
(* Example 1
============
Create a spec and pass it into the makeImage function. *)
(* Example 1: Create a spec and pass it into the makeImage function.
==================================================================== *)
// Create your spec in another function...
|> makeImage
|> Async.Run
(* Example 2
============
Create a spec (with no overlay) at the same time you call the
makeImage function. *)
(* Example 2: Create a spec (with no overlay) at the same time you
call the makeImage function.
==================================================================== *)
{ width = 500
height = 500
@ -78,10 +76,9 @@ makeImage function. *)
|> makeImage
|> Async.Run
(* Example 3
============
Create a spec (with A full overlay) at the same time you call the
makeImage function. *)
(* Example 3: Create a spec (with A full overlay) at the same time
you call the makeImage function.
==================================================================== *)
let fullOverlay =
{ colour = Brush.Black
@ -96,10 +93,9 @@ let fullOverlay =
|> makeImage
|> Async.Run
(* Example 4
============
Create a spec (with A border overlay) at the same time you call the
makeImage function. *)
(* Example 4: Create a spec (with A border overlay) at the same time
you call the makeImage function.
=====================================================================*)
let borderOverlay =
{ colour = Brush.Red
@ -114,4 +110,27 @@ let borderOverlay =
|> makeImage
|> Async.Run
(* Example 5: The verbose example.
=====================================================================*)
let borderOverlay =
{ colour = Brush.Pink
overlayType = Border }
let spec =
{ width = 500
height = 500
colour = Brush.AntiqueWhite
filePath = "C:/path/to/save/at"
overlay = some (borderOverlay)
}
spec
|> makeImage
|> Async.Run
// or...
makeImage spec
|> Async.Run
```

Loading…
Cancel
Save