Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .changeset/text-centred-and-layered.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/window-built-by-java.md

This file was deleted.

32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
---
name: Changelog
index: 66
index: 67
lang: en
---

## 5.3.0



Plain text now sits on the position it was given. It used to be drawn eight
pixels down and to the right of it - the padding a framed style needs between
its border and its words, which plain words have no use for - so a centred label
never landed on the thing it labelled: a number put at the middle of a line came
out beside it. The words are now centred on their position, the way a sprite put
there is.

A width too narrow to hold a single letter no longer wraps the words at all. It
used to turn them into a column of one letter per line: `new Text("42", x, y, 1)`
drew a 4 above a 2. Line breaks written into the text are still kept.

`Text` can also be layered like a sprite: `goToFrontLayer()`, `goToBackLayer()`,
`goLayersForwards(int)` and `goLayersBackwards(int)` decide which of several
overlapping texts is on top. Texts are drawn above the sprites, so this orders a
text against the other texts.


A class that extends `Window` and has a `main` method which is not static no
longer fails with "Cannot create multiple Windows!". Since Java 21 the JVM
builds an instance of such a class before it calls `main`, so the
`new MyWindow()` inside `main` was the second window and the project stopped
before it started. That window is now reused, and a note explains how to be rid
of the extra one by making `main` static. Two windows asked for by the project
itself are still an error.


## 5.2.0


Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.openpatch</groupId>
<artifactId>scratch</artifactId>
<version>5.2.0</version>
<version>5.3.0</version>
<packaging>jar</packaging>

<name>Scratch for Java</name>
Expand Down
Loading