Skip to content

Commit fe07de9

Browse files
committed
Add/improve documentation
1 parent 042b5b8 commit fe07de9

File tree

3 files changed

+69
-26
lines changed

3 files changed

+69
-26
lines changed

docs/API.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,54 @@ Currently the API consists of the following methods:
1010

1111
#### Navigate Scenes
1212

13-
* IDE_Morph.prototype.getScenes()
14-
* IDE_Morph.prototype.getCurrentScene()
15-
* IDE_Morph.prototype.switchTo()
13+
* `IDE_Morph.prototype.getScenes()`
14+
* `IDE_Morph.prototype.getCurrentScene()`
15+
* `IDE_Morph.prototype.switchTo()`
1616

1717
#### Control Processes
1818

19-
* IDE_Morph.prototype.isRunning()
20-
* IDE_Morph.prototype.stop()
19+
* `IDE_Morph.prototype.isRunning()`
20+
* `IDE_Morph.prototype.stop()`
2121

2222
#### Broadcast Messages (and optionally wait)
2323

24-
* IDE_Morph.prototype.broadcast()
24+
* `IDE_Morph.prototype.broadcast()`
2525

2626
#### Listen to Messages
2727

28-
* IDE_Morph.prototype.addMessageListenerForAll()
29-
* IDE_Morph.prototype.addMessageListener()
30-
* IDE_Morph.prototype.getMessages()
28+
* `IDE_Morph.prototype.addMessageListenerForAll()`
29+
* `IDE_Morph.prototype.addMessageListener()`
30+
* `IDE_Morph.prototype.getMessages()`
3131

3232
#### Access Global Variables
3333

34-
* IDE_Morph.prototype.getVarNames()
35-
* IDE_Morph.prototype.getVar()
36-
* IDE_Morph.prototype.setVar()
34+
* `IDE_Morph.prototype.getVarNames()`
35+
* `IDE_Morph.prototype.getVar()`
36+
* `IDE_Morph.prototype.setVar()`
3737

3838
#### Create and Modify Lists
3939

40-
* IDE_Morph.prototype.newList()
40+
* `IDE_Morph.prototype.newList()`
4141

4242
#### Access the Serialized Project
4343

44-
* IDE_Morph.prototype.getProjectXML()
45-
* IDE_Morph.prototype.loadProjectXML()
46-
* IDE_Morph.prototype.unsavedChanges()
44+
* `IDE_Morph.prototype.getProjectXML()`
45+
* `IDE_Morph.prototype.loadProjectXML()`
46+
* `IDE_Morph.prototype.unsavedChanges()`
4747

4848
#### Synchronize Scripts
4949

50-
* IDE_Morph.prototype.getSpriteScriptsXML()
51-
* IDE_Morph.prototype.loadSpriteScriptsXML()
50+
* `IDE_Morph.prototype.getSpriteScriptsXML()`
51+
* `IDE_Morph.prototype.loadSpriteScriptsXML()`
5252

5353
#### Highlight Blocks
5454

55-
* IDE_Morph.prototype.flashSpriteScripts()
56-
* IDE_Morph.prototype.unflashSpriteScripts
55+
* `IDE_Morph.prototype.flashSpriteScripts()`
56+
* `IDE_Morph.prototype.unflashSpriteScripts`
5757

5858
#### Set the Language
5959

60-
* IDE_Morph.prototype.setTranslation()
60+
* `IDE_Morph.prototype.setTranslation()`
6161

6262
## Referencing the IDE
6363

docs/Migrating.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The second section is a recipe how to actually migrate your code. It's a list of
2727
- `silentSetWidth` => use `bounds.setWidth()` to avoid infinite recursion
2828
- `silentSetHeight` = use `bounds.setHeight()` to avoid infinite recursion
2929
* likewise "silent" parameters to functions are no longer needed and supported and should simply be removed
30-
* `cachedFullImage` has been removed and is no longer available (except internally for the HandMorph)
30+
* `cachedFullImage` has been removed and is no longer available (except internally for the HandMorph)
3131
* `cachedFullBounds` has been removed and is no longer available (except internally for the HandMorph)
3232
* `trackChanges` and other damage-list housekeeping tweaks are no longer needed and no longer supported, except for the Pen constructor's isWarped property and its methods, such as `startWarp()` and `endWarp()`.
3333
* Pen >> `wantsRedraw` is no longer needed and deprecated
@@ -40,7 +40,7 @@ The second section is a recipe how to actually migrate your code. It's a list of
4040
* `fullImageClassic()` => is now always just `fullImage()`
4141
* `keyboardReceiver` => `keyboardFocus`
4242
* keyboard navigation can be activated for any visible menu by pressing an arbitrary key
43-
* new `noDropShadow` property for Morphs that already have built-in shadows (Menus, SpeechBubbles)
43+
* new `noDropShadow` property for Morphs that already have built-in shadows (Menus, SpeechBubbles)
4444
* new `fullShadowSource` flag for Morphs, default is `true`, turn off (`false`) to only use the simple image instead of `fullImage()`
4545

4646
## Migrating Your Sources
@@ -53,9 +53,9 @@ Search your code for these words and replace them according to the instructions.
5353
- rename method definitions to `render`, notice that the first argument needs to be the 2D context, therefore remove the part in the code that makes a new canvas and queries its context.
5454
- factor out the parts of the code that determine and set the extent and add or arrange submorphs and move them into a - possibly new - method named `fixLayout()`
5555
- rename function calls to `drawNew()` to `fixLayout()` and/or `rerender()`, check whether the call is at all needed as it might be redundant in the new system
56-
* **wantsRedraw** => replace with `rerender()`
57-
* **noticesTransparentClick** => replace with `!isFreeForm`, use with caution, as free forms should also cache their image for performance reason, which in turn strains memory usage
58-
* **.image** => rename getters to `getImage()`, use with caution because of performance bottlenecks
56+
* **wantsRedraw** => replace with `rerender()`
57+
* **noticesTransparentClick** => replace with `!isFreeForm`, use with caution, as free forms should also cache their image for performance reason, which in turn strains memory usage
58+
* **.image** => rename getters to `getImage()`, use with caution because of performance bottlenecks
5959
* **cachedFullImage** => no longer supported, remove all references
6060
* **fullImageClassic** => rename method calls to just `fullImage()`
6161
* **silentSet**

docs/README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Snap<em>!</em> Development Documentation
2+
> last updated May 6, 2023.
3+
4+
This guide is intended for _developers_ who want to ingrate Snap! into existing projects. Each of these guides is a breif introduction to maintaining an extension. The goal is to _minimize_ the amount of customizations you need to make to the Snap! source code, located in `src/`.
5+
6+
**Before contributing source code modifications, please review [the contributations guide](./CONTRIBUTING.md) and get in touch!
7+
8+
_Note:_ This document applies only to the Snap! IDE. The Snap!Cloud backend lives at [@snap-cloud/snapCloud](https://github.com/snap-cloud/snapCloud) on GitHub.
9+
10+
## Guides
11+
12+
There are many ways to build your own customized Snap! environments. Start in this order, with the least customizations.
13+
14+
### Microworlds
15+
16+
Microworlds are restricted Snap! environments, which hide blocks, and may change some settings that are saved with the project.
17+
18+
Things you can save with the project:
19+
20+
* Hiding Blocks
21+
* Single Palette Settings
22+
* Disable Click-to-Run
23+
* Disable Dragging Data
24+
25+
_More coming soon!_
26+
27+
### [Extensions.md](./Extensions.md)
28+
29+
You can write JavaScript files which provide additional blocks, add interface elements, etc. These extensions are often packaged as a Snap! library.
30+
31+
### [API.md](./API.md)
32+
33+
The Snap! API can be used to embed or customize Snap! to be used in unique environments. You can check out the (work in progress) [Pyret example](../pyret/inline.html).
34+
35+
### [Offline.md](./Offline.md)
36+
37+
This describes how you can distribute Snap! to work offline.
38+
39+
---
40+
41+
### [Migrating.md](./Migrating.md)
42+
43+
This describes the internal changes to the Morphic library. It is probably not useful unless you have made a fork of Snap!.

0 commit comments

Comments
 (0)