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
Copy file name to clipboardexpand all lines: docs/Migrating.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ The second section is a recipe how to actually migrate your code. It's a list of
27
27
-`silentSetWidth` => use `bounds.setWidth()` to avoid infinite recursion
28
28
-`silentSetHeight` = use `bounds.setHeight()` to avoid infinite recursion
29
29
* 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)
31
31
*`cachedFullBounds` has been removed and is no longer available (except internally for the HandMorph)
32
32
*`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()`.
33
33
* 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
40
40
*`fullImageClassic()` => is now always just `fullImage()`
41
41
*`keyboardReceiver` => `keyboardFocus`
42
42
* 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)
44
44
* new `fullShadowSource` flag for Morphs, default is `true`, turn off (`false`) to only use the simple image instead of `fullImage()`
45
45
46
46
## Migrating Your Sources
@@ -53,9 +53,9 @@ Search your code for these words and replace them according to the instructions.
53
53
- 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.
54
54
- 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()`
55
55
- 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
59
59
***cachedFullImage** => no longer supported, remove all references
60
60
***fullImageClassic** => rename method calls to just `fullImage()`
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