|
1 | 1 | --- |
2 | 2 | name: Changelog |
3 | | -index: 76 |
| 3 | +index: 77 |
4 | 4 | lang: en |
5 | 5 | --- |
6 | 6 |
|
| 7 | +## 6.0.0 |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +`TiledMap.spawn("Objects")` creates a sprite for each object of a layer whose |
| 12 | +type (Tiled's "class") is the name of a sprite class, puts it where the object |
| 13 | +is and adds it to the stage. Objects drawn as areas give their sprite that area |
| 14 | +as its hitbox. The sprite class needs a constructor taking the `MapObject`, one |
| 15 | +taking `(double x, double y)`, or one without parameters. |
| 16 | + |
| 17 | + |
| 18 | +A sprite that only draws with its pen no longer shows the red "?" marker for a |
| 19 | +missing costume. The marker (and its warning) now appears only for a sprite that |
| 20 | +stays without a costume, a hitbox and a used pen for a second. |
| 21 | + |
| 22 | + |
| 23 | +Editors can show a preview of a stage: started with |
| 24 | +`-Dscratch4j.preview=<folder>`, a program draws the first frame of its stage, |
| 25 | +saves it as `frame.png` with the sprites described in `stage.json`, and ends. |
| 26 | +`-Dscratch4j.preview.stage=<Class>` previews another stage, and |
| 27 | +`-Dscratch4j.preview.omit=<fields>` leaves the sprites in those fields out of |
| 28 | +the picture. |
| 29 | + |
| 30 | + |
| 31 | +💥 BREAKING CHANGE: A stage no longer opens the window itself. Create the window |
| 32 | +first and put the stage into it: |
| 33 | + |
| 34 | +```java |
| 35 | +Window myWindow = new Window(480, 360); |
| 36 | +myWindow.setStage(new MyStage()); |
| 37 | +``` |
| 38 | + |
| 39 | +`new Stage(width, height)` and `new Stage(width, height, assets)` are gone: a |
| 40 | +stage is always as big as the window it is shown in, so the size (and the assets |
| 41 | +folder) go to `new Window(...)`. Remove `super(width, height)` from your stages. |
| 42 | +A stage made before there is a window says how to fix it, and a window nobody |
| 43 | +put a stage into says so too. |
| 44 | + |
| 45 | + |
7 | 46 | ## 5.8.0 |
8 | 47 |
|
9 | 48 | Add the Scratch for Java cat as built-in sprites. Its animations - idle, walk, crouch, jump, fall, land, punch, hurt, ko, cheer and climb - load by name, for example `addAnimation("walk", "cat_walk_%d", 6)`. Coffee beans, a bug, a goal mug and hearts for a platformer come with it. The new Cat Platformer example shows them all in a game. |
|
0 commit comments