Repository navigation
Added
- Particles: a
depthsetting, so particles under aCamera3dspawn through a volume instead of on a flat sheet - Text:
paintOrder, to draw the outline behind the glyphs ("stroke", the default) or over them ("fill") - Text:
lineJoinandmiterLimit, the shape of the outline's corners ("round"by default,"bevel"or"miter") - UI:
UICheckbox, a checkbox with its label, that becomes a radio button with agroup(#1722) - UI:
UISlider, a horizontal or vertical slider withmin,maxandstep, moved by dragging, clicking the track or the mouse wheel - UI:
UIPanellays out its children ("column","row"or"grid"), scrolls them, and takes a nine-sliceskin, atitleanddraggable - UI:
UITextButtontakesonClick, askinandpressedColor, and the size, font and color settings the other widgets use;labelis its text object - UI: every
UIBaseElementhasenabled,cancelPress()/onCancel(), and a hover and press bounce (hoverScale,pressScale) - UI: keyboard and gamepad navigation between widgets, once one takes the focus with
focus() - UI: drop shadows on
UIPanelandProgressBar(shadowColor,shadowOffsetX,shadowOffsetY,shadowBlur) - UI:
UISpriteElementis aUIBaseElementholding aSprite, so it has everything the other widgets have;Spritemembers other than its region and animation methods are onelement.sprite - UI: the widgets' settings and skin types are exported,
ProgressBar'sonChangealso gets the bar, andContainer#clipContains(x, y)tells whether a container shows its children at a point
Deprecated
- UI:
UITextButton#bitmapText, forlabel
Fixed
- Rendering: a translucent
setColor()no longer fades what is drawn after it, nor changesgetGlobalAlpha() - Rendering: on WebGL and WebGPU, a clip inside a clip is their overlap, as on Canvas (#1816)
- WebGL:
fillArc()handles an end angle before the start, andsave()/restore()keeplineWidthandlineJoin, as on Canvas - Camera: post effects on a camera no longer wipe out the cameras drawn before it; a minimap with effects shows the view behind where it draws nothing
- Camera:
worldToLocal()/localToWorld()are right on a minimap or zoomed camera when the level is centred - Camera:
fadeIn()andfadeOut()always callonComplete(#1810) - Container:
reset(), and solevel.load, keeps the pending sort of the persistent children it keeps - Container:
onDeactivateEventis called once per child of a removed container, not twice or more - Container:
enableChildBoundsUpdatefollows moving children, so the camera no longer culls the group - Container: physics bodies of nested children are added and removed at any depth; moving a group with bodies to another container no longer throws
- World: a persistent container's children keep their physics bodies through a state change or
level.load - Sprite: redefining the playing animation no longer crashes the next update when it is shorter
- Sprite: a
flicker()callback gets the sprite asthis, after the flicker has ended - Particles: particles follow their emitter's
visibilityLayer - Particles: an emitter without an
imageno longer leaks a texture per emitter orreset(); all share the renderer's white pixel (#1807) - Text: an outline no longer hides thin letters or gets cut off at the edges. Its corners are round by default and only its outer half shows: double
lineWidthto keep its weight, or usepaintOrder: "fill"andlineJoin: "miter"for the old look - Text: word wrap keeps
\nline breaks, and no longer adds a blank first line for a long first word (Text and BitmapText) - Text: multi-line text is placed by
textBaselineas one block, as BitmapText is, so it stays inside its bounds - Text:
setText("1,000")after["1", "000"]updates the text (Text and BitmapText) - Text:
measureText("other text")no longer changes the label's own size and alignment (Text and BitmapText) - UI: a press on a UI element no longer also reaches the game behind it (
onClick()/onRelease()returnfalseby default; returntrueto let it through) - UI: a
UITextButtonwith a CSS font no longer throws, draws its background where it is after a move, and no longer writes into its settings - UI: a blocking
UIPanelstays opaque to hover while the pointer is on it - UI: dragging works by touch, and a dragged element in the world no longer jumps by the camera position
- UI: hover survives a click, and ends when the pointer leaves the canvas or is cancelled
- UI: a child clipped out of view gets no pointer events where it is hidden
- UI:
ProgressBarre-clamps its value whenminormaxchange - Physics: a resting body stays grounded under heavier gravity or mass, at a low frame rate or on a rising floor
- Physics:
applyForce()reads its contact point in world coordinates, so a body away from the origin no longer spins the wrong way - Physics:
setAngle()and angular velocity turn a body about its centre, not a corner, whatever itsanchorPoint - Physics: a counter-clockwise polygon no longer collides with circles nowhere near it
- Physics: a raycast no longer throws on
Point,SphereorBox3dshapes, and hits a rotatedEllipsewhere it is - Tiled: infinite maps place every chunk at its own column and row instead of wrapping tiles into other rows.
cellAt()/setTile()take Tiled's tile coordinates, andTMXLayer.startx/startygive where the layer starts - Tiled: on staggered maps
getTile()finds the right tile on every row, and a scrolled map draws again - Tiled:
getTile()returnsnulljust outside isometric, staggered and oblique maps - Tiled: no missing tiles at the view edges on staggered, hexagonal and oblique maps or with
left/uprender orders, and no hang when the view is outside a layer - Tiled: a tileset with a margin no longer takes the next tileset's tile ids, and an image collection covers all its tiles
- Tiled: a map without
nextobjectidno longer gives new objects the GUIDs of its own (#1809) - Loader: assets on the game's own origin are requested with its cookies and HTTP auth (#1801)
- Loader: an asset on another origin loads whenever its server allows it (CORS), and one it blocks fails at load with an error naming it.
crossOriginnow only applies to<video>,<script>and glTF images;"use-credentials"sends credentials, aswithCredentialsdoes - Loader: a
preload()with no callback no longer calls the previous one's callback, andreload()works for custom asset types - Loader: progress restarts at each preload, and reaches 1 after a failed asset
- Save: a key set again after
remove()survives a reload - Tween: a path (array) tween no longer grows on each restart, nor turns
NaNwithyoyo - Tween: a repeating or
yoyotween repeats again when restarted - Math:
isPowerOfTwo()rejects zero, negative and fractional values (thanks @mmporong) - Math:
round()rounds negative values correctly and handles values past 2^31;isPowerOfFour()rejects fractions - Math: the observable vectors'
negateSelf(),floorSelf(),ceilSelf()andclampSelf()return the vector and notify once - Color:
parseHex()keeps the full alpha precision (thanks @mmporong) - Geometry:
Line#contains()no longer reports points beyond the segment's ends (thanks @mmporong) - Geometry:
Ellipse#scale()keeps the rotation - Pool:
purge()keeps counting the instances still in use
Full Changelog: 20.12.0...20.13.0