Release v5.1.0 - #32
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A text shows the words it was built with.
new Text("Hello World", 0, 0, 400)put nothing on the stage - the constructorleft it hidden until
showText(). A text built with words is visible now; onebuilt 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.setStylehad no counterpart.changePositiontakes two numbers as well as a vector.Moving by an amount worked only when the amount was already a
Vector2, thoughsetPositionhas 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 toshown 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 halfsee-through.
A
Colorsays which colour it is.Printing one gave
org.openpatch.scratch.Color@35432107, which is the firstthing 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 areequal.
A built-in sprite name works everywhere a picture is named.
new Sprite("player", "slimeGreen")threwCould not load image: slimeGreen:the constructor took a path where
addCostume()took either. It now takeseither, as do
Stage.setCursor,Window.useSplashLogoandSprite.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: thedrawing 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.
setAlignmoves 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.countreturns anint.It returned the
longaStreamhappened to hand back, soint coins = myStage.count(Coin.class)did not compile.A stage's ghost and colour effects survive a change of backdrop.
setTransparency,setTintandchangeTintreached only the backdrop that wasshowing, so switching backdrop quietly undid them. They now reach all of them, as
a sprite's have always reached all its costumes.
Window.addStage,switchStageandremoveStageare gone.Deprecated since 4.0.0 in favour of
setStage, which holds the stage you give itrather than a name you have to remember, and
transitionToStagewhen the changeshould fade.
removeStageneeds no replacement: a stage the window is not showing does notrun.
Operators.mod answers the way the Scratch block does.
It was Java's
%, whose answer takes the sign of the first input, somod(-7, 3)was -1 where the block says 2. The answer now takes the sign of thesecond 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 outas 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, soa 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.