Skip to content

Release v5.1.0 - #32

Merged
mikebarkmin merged 1 commit into
mainfrom
changeset
Jul 28, 2026
Merged

Release v5.1.0#32
mikebarkmin merged 1 commit into
mainfrom
changeset

Conversation

@github-actions

Copy link
Copy Markdown

A text shows the words it was built with.

new Text("Hello World", 0, 0, 400) put nothing on the stage - the constructor
left it hidden until showText(). A text built with words is visible now; one
built with nothing to say still starts hidden, which is what a speech bubble
waiting for say() wants.

Text.getStyle() answers with the style a text is drawn in.

setStyle had no counterpart.

changePosition takes two numbers as well as a vector.

Moving by an amount worked only when the amount was already a Vector2, though
setPosition has taken two numbers all along.

Transparency is the Scratch ghost effect.

It ran from 0 to 255, where 0 was invisible and 255 the solid sprite you start
with — upside down and on the wrong scale next to the set [ghost v] effect to
shown beside it. It now runs 0 to 100, 0 solid and 100 invisible, and a value
outside that is pinned rather than wrapped.

mySprite.setTransparency(50) used to be nearly invisible; it is now half
see-through.

A Color says which colour it is.

Printing one gave org.openpatch.scratch.Color@35432107, which is the first
thing anyone tries when a tint looks wrong. It now reads
Color[r=255.0, g=128.0, b=0.0], and two colours with the same channels are
equal.

A built-in sprite name works everywhere a picture is named.

new Sprite("player", "slimeGreen") threw Could not load image: slimeGreen:
the constructor took a path where addCostume() took either. It now takes
either, as do Stage.setCursor, Window.useSplashLogo and
Sprite.addCostumes. A string with a file extension is still a path.

A framed text is rounded on all four corners.

Only the top two were. The stage's display line keeps its bottom two square,
because they sit on the edge of the stage where a curve would only show what is
behind it.

Speech and thought bubbles work on a text of their own.

setStyle(TextStyle.SPEAK) on a text you placed yourself drew nothing: the
drawing gave up unless the text belonged to a sprite, because it took its
position from that sprite. Such a text now keeps the position it was given.

Speech and thought bubbles hang off the sprite's hitbox.

They were placed from the size of the costume, which is usually a canvas bigger
than what is painted on it, so the bubble floated up and to the right of its
sprite with its tail pointing at nothing. It now sits on the top right corner of
the hitbox. For the built-in slime that moves it 14 pixels left and 72 down, onto
its shoulder.

setAlign moves the frame, not only the words inside it.

The frame always started at the position it was given, so a centred box was not
centred on anything and its words sat half outside it. An aligned text also sat a
line too high, because choosing a horizontal alignment put the vertical one back
to the baseline.

Stage.count returns an int.

It returned the long a Stream happened to hand back, so
int coins = myStage.count(Coin.class) did not compile.

A stage's ghost and colour effects survive a change of backdrop.

setTransparency, setTint and changeTint reached only the backdrop that was
showing, so switching backdrop quietly undid them. They now reach all of them, as
a sprite's have always reached all its costumes.

Window.addStage, switchStage and removeStage are gone.

Deprecated since 4.0.0 in favour of setStage, which holds the stage you give it
rather than a name you have to remember, and transitionToStage when the change
should fade.

myWindow.addStage("level", level);   // was
myWindow.switchStage("level");
myWindow.setStage(level);            // now

removeStage needs no replacement: a stage the window is not showing does not
run.

Operators.mod answers the way the Scratch block does.

It was Java's %, whose answer takes the sign of the first input, so
mod(-7, 3) was -1 where the block says 2. The answer now takes the sign of the
second input, which is what makes it wrap a value into a range without a special
case: mod(-1, 10) is 9.

Drawing a text no longer writes its measured size back into it.

A box drawn after a bubble came out the size of that bubble, and getWidth()
answered with whatever was last drawn rather than the width that was set.

A framed text is drawn around its words rather than filling the width it was given.

The width is where the words wrap. new Text("Hello World", 0, 0, 400) came out
as a mostly empty 400 pixel frame running off the side of the stage; it now comes
out as wide as "Hello World". The stage's display line still reaches from edge to
edge, because it is a band rather than a label.

A text built with words can be drawn at all.

new Text(words, x, y, width) never set a style, and drawing switches on one, so
a text built that way threw on every frame - from inside the loading screen,
which the program then never left. A white stage, nothing drawn, and no error
where anyone would look for it.

@mikebarkmin
mikebarkmin merged commit 033e350 into main Jul 28, 2026
@github-actions
github-actions Bot deleted the changeset branch July 28, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant