Releases: excaliburjs/Excalibur
Excalibur v0.31.0 Release
Added
- Added new
ex.Camera.setStrategies()andex.Camera.strategiesfor additional control of strategy order - Fixed ex.Font measureText always using 10px sans-serif on the first call on some browsers
- Added a new
ex.Sound({...})option back constructor to set all the same props available on sound - Added a new
ex.SoundManagertype for managing groups of audio/sound effects/music volume in an easier way
const soundManager = new ex.SoundManger({
channels: ['fx', 'music', 'background'],
sounds: {
jumpSnd: { sound: jumpSnd, volume: 0.4, channels: ['fx'] },
forestSnd: { sound: forestSnd, volume: 0.2, channels: ['music', 'background'] },
challengeMusic: { sound: challengeMusic, volume: 0.2, channels: ['music'] },
guitarLoop: { sound: guitarLoop, volume: 0.2, channels: ['music'] }
}
});
// play a specific sound
soundManager.play('jumpSnd');
// mute a specific channel with all member sounds
soundManager.channel.mute('music');
// mute all sound
soundManager.mute();
// unmute all sound that was previously muted, and resume playing from the current location
soundManager.unmute();
// unmute a specific channel that was muted
soundManager.channel.unmute('music');
// play a specific channel
soundManager.channel.play('music');
// set the max volume of an entire channel
soundManager.channel.setVolume('music', 0.9);- Added
ex.Animation.datato store arbitrary meta data for an animation. Data can be directly added in the constructor as an option, by using the optionaldataargument infromSpriteSheet(...)and as an option infromSpriteSheetCoordinates({...}) - Added a new configuration option to
ex.Engine({global: ...})where you can provide a keyboard global to override if iframe detection fails for anyway. - Added new way to output data from scenes
onDeactivate(), returning data will be passed to the nextSceneActivationContextin thepreviousSceneDataproperty! - Added new
transitionstartandtransitionendevents toex.Scenes - Pipe
navigation*events toex.Engine - Added ability to use
ex.Vectorto specify offset and margin inSpriteSheet.fromImageSource({..}) - New PostProcessor.onDraw() hook to handle uploading textures
- Adds contact solve bias to RealisticSolver, this allows customization on which direction contacts are solved first. By default there is no bias set to 'none'.
- Queries can now take additional options to filter in/out by components or tags.
const query = new Query({
// all fields are optional
components: {
all: [ComponentA, ComponentB] as const, // important for type safety!
any: [ComponentC, ComponentD] as const, // important for type safety!
not: [ComponentE]
},
tags: {
all: ['tagA', 'tagB'],
any: ['tagC', 'tagD'],
not: ['tagE']
}
})
// previous constructor type still works and is shorthand for components.all
new Query([ComponentA, ComponentB] as const)- Queries can now match all entities by specifying no filters
const query = new Query({})- Adds
maxVelattribute toMotionComponent, which clamps velocity on separated X and Y axes - Add
Clock.clearSchedule(id)and haveClock.schedulereturn an ID so you can clear a scheduled callback before it fires
Fixed
- Fixed issue where
ParticleEmitterParticledid not receive z index value from emitter when in World space - Fixed issue where an animation that was
anim.reset()inside of an animation event handler likeanim.once('end', () => anim.reset())would not work correctly - Fixed issue where
GpuParticleEmitterdid not rotate with their parents - Fixed issue where Cpu
ParticleEmitterdid not respectParticleTransform.Local - Fixed issue where same origin iframes did not work properly with keyboard & pointer events
- Fixed issue where the initial scene onPreLoad was not being run
- Fixed unecessary coupling with
ex.ColliderComponent/ex.BodyComponentthat prevented collider tracking on entities that haveex.TransformComponent/ex.ColliderComponent, this influenced users doing Entity level ECS with pointer events. - Fixed issue where passing 0 to
ex.Sound.play(0)would not set the volume to 0, instead the previous volume would play. - Fixed issue where the Actor.color did not respect being set
- Fixed offscreen culling issue when using parallax on TileMaps
- Fixed division by 0 when timescale is 0 in actions
- Fixed
onTransitionon the initial scene transition - Fixed
ex.TriggerOptionstype to all optional parameters - Fixed issue where the ActorArgs type hint would not error when providing a color causing confusion when it didn't produce a default graphic.
- Fixed false positive warning when adding timers
- Fixed issue where gamepad buttons wouldn't progress the default loader play button
- Add defense around middling Safari fullscreen support and update documentation
- Fixed issue where non-standard gamepad buttons would not be emitted by Excalibur
- Added an additional param to the
ex.GamepadButtonEventindexto disabiguate betweenex.Buttons.Unknown
- Added an additional param to the
- Fixed issue where Realistic solver would not sort contacts by distance causing some artifacts on seams
- Fixed issue with CompositeCollider where large TileMaps would sometimes causes odd collision behavior in the Realistic Solver when the body & collider components are far apart in a TileMap.
- Fixed crash on Xiaomi Redmi Phones by lazy loading the GPU particle renderer, GPU particles still do not work on these phones
- Add warning if World.add() falls through! This is caused by multiple versions of Excalibur usually
- Fixed CollidePolygonPolygon crash with some defense against invalid separation
- Fixed issue with PostProcessor where it would not run correctly if no actors present
- Removed warning in development for unadded entities
- Fixed memory leaks from retained entities in
Map<Entity>
Changed
- Updated
ex.Camera.addStrategy()to accept multiple strategies - Changed the behavior of
fromSpriteSheet(...),fromSpriteSheetCoordinates({...})andclone()ofex.Animationto return the subclass if called from there - Optimized BoundingBox.rayCast and BoundingBox.rayCastTime
- Optimized BoundingBox.intersect(otherBoundingBox)
- Change logging behavior for entities not in scenes, only log in dev builds
What's Changed
- BUG: fixed actor cloning of null collider, added test by @jyoung4242 in #3345
- docs: update Bluesky href to current by @chrisalley in #3347
- Revert "chore: Update docusaurus monorepo to v3.7.0" by @eonarheim in #3349
- fix: composite multi contact by @eonarheim in #3351
- fix: Spritesheet Spacing Options, allowing Vectors by @jyoung4242 in #3350
- fix: Add missing events for transitions + Fix onTransition for initial scene transition by @eonarheim in #3359
- docs: fix typo "n Excalibur" -> "in Excalibur" in tutorial step 03 by @npretto in #3361
- feat: Implement Uniform Buffers Object Support by @eonarheim in #3360
- docs: new years post by @eonarheim in #3344
- fix: TileMap meshes properly when transform changes by @eonarheim in #3384
- DOCS: Update screens-display-modes.mdx by @jyoung4242 in #3407
- docs: adds additional details to building up an isometric scene by @chrisk-7777 in #3411
- chore: migrate tests to vitest by @mattjennings in #3381
- fix: [#3389] TileMap culling when using parallax by @eonarheim in #3406
- #3424 feat: Add maxVel to MotionComponent by @kfalicov in #3425
- BugFix : Issue 3427, ScreenAppender blocks pointerevents by @jyoung4242 in #3428
- add EulerIntegrator tests by @mattjennings in #3429
- updated Meet action to add tolerance by @jyoung4242 in #3385
- feat(Clock): Add API to clearSchedule by @kamranayub in #3446
- Use vite for excalibur build by @mattjennings in #3434
- feat: Implement Scene deactivation data passing by @eonarheim in #3449
- fix: [#3412] collider body coupling by @eonarheim in #3451
- fix: [#3452] Initial scene respects onPreLoad by @eonarheim in #3453
- feat: support any, all and not component/tag filters on Query by @mattjennings in #3380
- Graph Module by @jyoung4242 in #3433
- refactor: Optimize BoundingBox/Raycast by @eonarheim in #3454
- Update 00-z-quick-start.mdx by @jyoung4242 in #3465
- Update 00-z-quick-start.mdx by @jyoung4242 in #3466
- Correct scene-crossfade.ts example by @eugenemed in #3467
- fix: ex.Random improve unique seeding on constructor w/o provided seed by @jyoung4242 in https://github....
Excalibur v0.30.3 Release
Added
- Adds contact solve bias to RealisticSolver, this allows customization on which direction contacts are solved first. By default there is no bias set to 'none'.
Fixed
- Fixed false positive warning when adding timers
- Fixed issue where gamepad buttons wouldn't progress the default loader play button
- Add defense around middling Safari fullscreen support and update documentation
- Fixed issue where non-standard gamepad buttons would not be emitted by Excalibur
- Added an additional param to the
ex.GamepadButtonEventindexto disabiguate betweenex.Buttons.Unknown
- Added an additional param to the
- Fixed issue where Realistic solver would not sort contacts by distance causing some artifacts on seams
- Fixed issue with CompositeCollider where large TileMaps would sometimes causes odd collision behavior in the Realistic Solver when the body & collider components are far apart in a TileMap.
What's Changed
- [#3320] Fix details in Tutorial - Building Flappy Bird by @cosmicarrow in #3321
- fix: CompositeCollider behavior affecting TileMap w/Realistic Solver by @eonarheim in #3322
- Update site showcase RetroSki url, title & description by @mathieuher in #3324
- fix: [#3317] gamepad support non standard buttons by @eonarheim in #3325
- chore: Update dependency excalibur-jasmine to v0.3.8 by @renovate in #3329
- chore: Update dependency @fortawesome/fontawesome-free to v6.7.2 by @renovate in #3326
- chore: Update dependency @types/react-color to v3.0.13 by @renovate in #3328
- chore: Update dependency prism-react-renderer to v2.4.1 by @renovate in #3330
New Contributors
- @cosmicarrow made their first contribution in #3321
Full Changelog: v0.30.2...v0.30.3
Excalibur v0.30.2 Release
Added
- New PostProcessor.onDraw() hook to handle uploading textures
Fixed
- Fixed crash on Xiaomi Redmi Phones by lazy loading the GPU particle renderer, GPU particles still do not work on these phones
- Add warning if World.add() falls through! This is caused by multiple versions of Excalibur usually
- Fixed CollidePolygonPolygon crash with some defense against invalid separation
- Fixed issue with PostProcessor where it would not run correctly if no actors present
Full Changelog: v0.30.1...v0.30.2
Excalibur v0.30.1 Release
- fix graphics tint issue
Read https://github.com/excaliburjs/Excalibur/releases/tag/v0.30.0 for more!
Full Changelog: v0.30.0...v0.30.1
Excalibur v0.30.0 Release
This is one of the biggest releases of Excalibur yet! Huge thanks to all the new contributors and everyone that assisted in the discord.
Special thanks @jyoung4242, @mattjennings, @cdelstad, @kamranayub, Drew Conley, and @jedeen for being constant support and help for the project and the entire community!
New Contributors
- @muhajirdev made their first contribution in #3026
- @aruru-weed made their first contribution in #3023
- @gavriguy made their first contribution in #3051
- @jellewijma made their first contribution in #3052
- @Autsider666 made their first contribution in #3094
- @robbertstevens made their first contribution in #3125
- @egodjuks made their first contribution in #3131
- @SamuelAsherRivello made their first contribution in #3174
- @mosesintech made their first contribution in #3214
- @blakearoberts made their first contribution in #3285
- @Adamduehansen made their first contribution in #3292
Features
- Added
ex.SpriteSheet.getTiledSprite(...)to help pulling tiling sprites out of a sprite sheet - Alias the
engine.screen.drawWidth/drawHeightwithengine.screen.width/height; - Added convenience types
ex.TiledSpriteandex.TiledAnimationfor Tiling Sprites and Animationsconst tiledGroundSprite = new ex.TiledSprite({ image: groundImage, width: game.screen.width, height: 200, wrapping: { x: ex.ImageWrapping.Repeat, y: ex.ImageWrapping.Clamp } }); const tilingAnimation = new ex.TiledAnimation({ animation: cardAnimation, sourceView: {x: 20, y: 20}, width: 200, height: 200, wrapping: ex.ImageWrapping.Repeat });
- Added new static builder for making images from canvases
ex.ImageSource.fromHtmlCanvasElement(image: HTMLCanvasElement, options?: ImageSourceOptions) - Added GPU particle implementation for MANY MANY particles in the simulation, similar to the existing CPU particle implementation. Note
maxParticlesis new for GPU particles.var particles = new ex.GpuParticleEmitter({ pos: ex.vec(300, 500), maxParticles: 10_000, emitRate: 1000, radius: 100, emitterType: ex.EmitterType.Circle, particle: { beginColor: ex.Color.Orange, endColor: ex.Color.Purple, focus: ex.vec(0, -400), focusAccel: 1000, startSize: 100, endSize: 0, life: 3000, minSpeed: -100, maxSpeed: 100, angularVelocity: 2, randomRotation: true, transform: ex.ParticleTransform.Local } });
- Added
ex.assert()that can be used to throw in development builds - Added
easingoption tomoveTo(...) - Added new option bag style input to actions with durations in milliseconds instead of speed
player.actions.rotateTo({angleRadians: angle, duration: 1000, rotationType}); player.actions.moveTo({pos: ex.vec(100, 100), duration: 1000}); player.actions.scaleTo({scale: ex.vec(2, 2), duration: 1000}); player.actions.repeatForever(ctx => { ctx.curveTo({ controlPoints: [cp1, cp2, dest], duration: 5000, mode: 'uniform' }); ctx.curveTo({ controlPoints: [cp2, cp1, start1], duration: 5000, mode: 'uniform' }); });
- Added
ex.lerpAngle(startAngleRadians: number, endAngleRadians: number, rotationType: RotationType, time: number): numberin order to lerp angles between each other - Added
pointerenterandpointerleaveevents toex.TileMaptiles! - Added
pointerenterandpointerleaveevents toex.IsometricMaptiles! - Added new
ex.BezierCurvetype for drawing cubic bezier curves - Added 2 new actions
actor.actions.curveTo(...)andactor.actions.curveBy(...) - Added new
ex.lerp(...),ex.inverseLerp(...), andex.remap(...)for numbers - Added new
ex.lerpVector(...),ex.inverseLerpVector(...), andex.remapVector(...)forex.Vector - Added new
actor.actions.flash(...)Actionto flash a color for a period of time - Added a new
ex.NineSliceGraphicfor creating arbitrarily resizable rectangular regions, useful for creating UI, backgrounds, and other resizable elements.var nineSlice = new ex.NineSlice({ width: 300, height: 100, source: inputTile, sourceConfig: { width: 64, height: 64, topMargin: 5, leftMargin: 7, bottomMargin: 5, rightMargin: 7 }, destinationConfig: { drawCenter: true, horizontalStretch: ex.NineSliceStretch.Stretch, verticalStretch: ex.NineSliceStretch.Stretch } }); actor.graphics.add(nineSlice);
- Added a method to force graphics on screen
ex.GraphicsComponent.forceOnScreen - Added new
ex.Slidescene transition, which can slide a screen shot of the current screen:up,down,left, orright. Optionally you can add anex.EasingFunction, by defaultex.EasingFunctions.Lineargame.goToScene('otherScene', { destinationIn: new ex.Slide({ duration: 1000, easingFunction: ex.EasingFunctions.EaseInOutCubic, slideDirection: 'up' }) });
- Added inline SVG image support
ex.ImageSource.fromSvgString('<svg>...</svg>'), note images produced this way still must be loaded. - Added ability to optionally specify sprite options in the
.toSprite(options:? SpriteOptions) - The
ex.Engineconstructor had a newenableCanvasContextMenuarg that can be used to enable the right click context menu, by default the context menu is disabled which is what most games seem to want. - Child
ex.Actorinherits opacity of parents ex.Engine.timeScalevalues of 0 are now supportedex.Triggernow supports all valid actor constructor parameters fromex.ActorArgsin addition toex.TriggerOptionsex.Gifcan now handle default embedded GIF frame timings- New
ex.Screen.worldToPagePixelRatioAPI that will return the ratio between excalibur pixels and the HTML pixels.- Additionally excalibur will now decorate the document root with this same value as a CSS variable
--ex-pixel-ratio - Useful for scaling HTML UIs to match your game
.ui-container { pointer-events: none; position: absolute; transform-origin: 0 0; transform: scale( calc(var(--pixel-conversion)), calc(var(--pixel-conversion))); }
- Additionally excalibur will now decorate the document root with this same value as a CSS variable
- New updates to
ex.coroutine(...)- New
ex.CoroutineInstanceis returned (still awaitable) - Control coroutine autostart with
ex.coroutine(function*(){...}, {autostart: false}) .start()and.cancel()coroutines- Nested coroutines!
- New
- Excalibur will now clean up WebGL textures that have not been drawn in a while, which improves stability for long game sessions
- If a graphic is drawn again it will be reloaded into the GPU seamlessly
- You can now query for colliders on the physics world
const scene = ...; const colliders = scene.physics.query(ex.BoundingBox.fromDimensions(...));
actor.oldGlobalPosreturns the globalPosition from the previous frame- create development builds of excalibur that bundlers can use in dev mode
- show warning in development when Entity hasn't been added to a scene after a few seconds
- New
RentalPooltype for sparse object pooling - New
ex.SparseHashGridCollisionProcessorwhich is a simpler (and faster) implementation for broadphase pair generation. This works by bucketing colliders into uniform sized square buckets and using that to generate pairs. - CollisionContact can be biased toward a collider by using
contact.bias(collider). This adjusts the contact so that the given collider is colliderA, and is helpful if you
are doing mtv adjustments during precollision. angleBetweenmedhod added to Vector class, to find the angle for which a vector needs to be rotated to match some given angle:const point = vec(100, 100) const destinationDirection = Math.PI / 4 const angleToRotate = point.angleBetween(destinationDirection, RotationType.ShortestPath) expect(point.rotate(angleToRotate).toAngle()).toEqual(destinationDirection)
Fixed
- Fixed issue where
ex.ParticleEmitter.clearParticles()did not work - Fixed issue where the pointer
lastWorldPoswas not updated when the currentCameramoved - Fixed issue where
cancel()'d events still bubbled to the top level input handlers - Fixed issue where unexpected html HTML content from an image would silently hang the loader
- Fixed issue where Collision events ahd inconsistent targets, sometimes they were Colliders and sometimes they were Entities
- Fixed issue where
ex.Engine.screenshot()images may not yet be loaded in time for use inex.Transitions - Fixed issue where there would be an incorrect background color for 1 frame when transitioning to a new scene
- Fixed issue where
blockInput: trueon scene transition only blocked input events, not accessors likewasHeld(...)etc. - Fixed issue where users could not easily define a custom
RendererPluginbecause the type was not exposed - Fixed issue where
ex.Fadesometimes would not complete depending on the elapsed time - Fixed issue where `ex.PolygonColliders...
Excalibur v0.29.3 Release
This is a maintenance release with only bug fixes!
Fixes
- fix: ex.Vector.toAngle() returns angles between [0, 2PI)
- fix: Make Entity Constructor's
componentsoption optional by @muhajirdev in #3027 - fix: getSceneName use scenes #3022 by @aruru-weed in #3023
- fix: Loader suppressPlayButton is now respected (0f9e77d)
- fix: [#3047] Animation glitch cause by uninitialized state by @eonarheim in #3048
New Contributors
- @muhajirdev made their first contribution in #3026
- @aruru-weed made their first contribution in #3023
- Special thanks to @djdenuyl for spotting a critical bug in image rendering! And a very thorough bug report!
Full Changelog: v0.29.2...v0.29.3
Excalibur v0.29.2 Release
This is a medium-ish release, with a ton of community contributions especially in the bugfix realm!
Features
- Added ability to configure image wrapping on
ex.ImageSourcewith the newex.ImageWrapping.Clamp(default),ex.ImageWrapping.Repeat, andex.ImageWrapping.Mirror.const image = new ex.ImageSource('path/to/image.png', { filtering: ex.ImageFiltering.Pixel, wrapping: { x: ex.ImageWrapping.Repeat, y: ex.ImageWrapping.Repeat, } });
- Added pointer event support to
ex.TileMap's and individualex.Tile's - Added pointer event support to
ex.IsometricMap's and individualex.IsometricTile's - Added
useAnchorparameter toex.GraphicsGroupto allow users to opt out of anchor based positioning, if set to false all graphics members
will be positioned with the top left of the graphic at the actor's position.const graphicGroup = new ex.GraphicsGroup({ useAnchor: false, members: [ { graphic: heartImage.toSprite(), offset: ex.vec(0, 0), }, { graphic: heartImage.toSprite(), offset: ex.vec(0, 16), }, { graphic: heartImage.toSprite(), offset: ex.vec(16, 16), }, { graphic: heartImage.toSprite(), offset: ex.vec(16, 0), }, ], });
- Added simplified
ex.coroutineoverloads, you need not pass engine as long as you are in an Excalibur lifecycleconst result = ex.coroutine(function* () {...});
- Added way to bind 'this' to
ex.coroutineoverloads, you need not pass engine as long as you are in an Excalibur lifecycleconst result = ex.coroutine({myThis: 'cool'}, function* () {...});
- Added optional
ex.coroutinetiming parameter to schedule when they are updatedconst result = ex.coroutine(engine, function * () {...}, { timing: 'postupdate' })
- Added
GraphicsComponent.boundswhich will report the world bounds of the graphic if applicable! - Added
ex.Vector.EQUALS_EPSILONto configure theex.Vector.equals(v)threshold - Added way to add custom WebGL context lost/recovered handlers for your game
const game = new ex.Engine({ handleContextLost: (e) => {...}, handleContextRestored: (e) => {...} })
Fixed
- Fixed issue where
ex.TileMapculling did not work properly when using fixed updates lower than refresh rate - Fixed incomplete types for font options in
ex.FontSource().toFont(options) - Fixed issue with
ex.Loaderstart button position when using CSS transforms - Fixed issue where adding scenes with the same name did not work when it was previously removed
- Fixed issue when WebGL context lost occurs where there was no friendly output to the user
- Fixed issue where HiDPI scaling could accidentally scale past the 4k mobile limit, if the context would scale too large it will now attempt to recover by backing off.
- Fixed issue where logo was sometimes not loaded during
ex.Loader - Fixed issue where unbounded containers would grow infinitely when using the following display modes:
DisplayMode.FillContainerDisplayMode.FitContainerDisplayMode.FitContainerAndFillDisplayMode.FitContainerAndZoom
- Fixed issue where
ex.ParticleEmitterz-index did not propagate to particles - Fixed incongruent behavior as small scales when setting
transform.scale = vandtransform.scale.setTo(x, y) - Fixed
ex.coroutineTypeScript type to include yieldingundefined - Fixed issue where Firefox on Linux would throw an error when using custom Materials due to unused attributes caused by glsl compiler optimization.
- Fixed issue where start transition did not work properly if deferred
- Fixed issue where transitions did not cover the whole screen if camera was zoomed
- Fixed issue where
Color.toHex()produced invalid strings if the channel values are negative or fractional, or if the alpha channel was different than 1
Changed
- Significant 2x performance improvement to image drawing in Excalibur
- Simplified
ex.Loaderviewport/resolution internal configuration
Raw Changes
What's Changed
- fix: Firefox + Linux custom shader issue with glsl compiler attribute optimization by @eonarheim in #2943
- chore: Update dependency @mdx-js/react to v3.0.1 by @renovate in #2945
- chore: Update dependency @types/react to v18.2.61 by @renovate in #2946
- chore: Update dependency @types/react-color to v3.0.12 by @renovate in #2947
- chore: Update dependency jasmine-core to v5.1.2 by @renovate in #2948
- chore: Update dependency karma to v6.4.3 by @renovate in #2949
- chore: Update dependency node to v20.11.1 by @renovate in #2950
- chore: Update babel monorepo to v7.24.0 by @renovate in #2951
- chore: Update dependency core-js to v3.36.0 by @renovate in #2952
- chore: Update dependency docusaurus-plugin-typedoc-api to v4.2.0 by @renovate in #2953
- chore: Update dependency eslint to v8.57.0 by @renovate in #2954
- chore: Update dependency eslint-plugin-storybook to v0.8.0 by @renovate in #2955
- chore: Update dependency prism-react-renderer to v2.3.1 by @renovate in #2956
- revert: "chore: Update dependency docusaurus-plugin-typedoc-api to v4.2.0" by @eonarheim in #2959
- fix: fit content resizing incorrectly by @eonarheim in #2960
- fix: Handle webgl context lost + Recover from hidpi scale too large by @eonarheim in #2958
- fix: Screen to world coord conversion when using fit container by @eonarheim in #2961
- feat: Allow coroutine lifecycles + support thisArg + remove engine requirement by @eonarheim in #2965
- fix: incomplete types for options in ex.FontSource.toFont() by @mattjennings in #2973
- chore: Correct the doc for vector.rotate by @isokissa in #2977
- Typo fix: post instead of pre. by @JustLeif in #2978
- fix: Update docs, SpriteFont by @sellmark in #2979
- change: GraphicsGroup no longer centers with anchors by @eonarheim in #2966
- feat: Add pointer events to TileMap/IsometricMap and tiles by @eonarheim in #2968
- perf: Remove allocations from image-renderer by @eonarheim in #2962
- fix: wrong hex color values by @mcavazotti in #2985
- chore: Update babel monorepo by @renovate in #2987
- chore: Update dependency @types/react to v18.2.73 by @renovate in #2988
- chore: Update dependency core-js to v3.36.1 by @renovate in #2989
- chore: Update dependency excalibur-jasmine to v0.3.4 by @renovate in #2990
- chore: Update dependency node to v20.12.0 by @renovate in #2992
- chore: Update dependency replace-in-file to v7.1.0 by @renovate in #2993
- chore: Update dependency webpack to v5.91.0 by @renovate in #2997
- chore: Update dependency semver to v7.6.0 by @renovate in #2994
- chore: Update docusaurus monorepo to v3.2.0 by @renovate in #3000
- Revert "chore: Update docusaurus monorepo to v3.2.0" by @eonarheim in #3002
- chore: Update storybook monorepo to v7.6.17 by @renovate in #3001
- chore(deps-dev): bump webpack-dev-middleware from 6.1.1 to 6.1.3 by @dependabot in #2999
- chore(deps): bump express from 4.18.2 to 4.19.2 in /site by @dependabot in #2984
- Web docs corrections by @ikudrickiy in #3004
- chore(deps-dev): bump follow-redirects from 1.14.8 to 1.15.6 by @dependabot in #2967
- chore(deps-dev): bump express from 4.18.2 to 4.19.2 by @dependabot in #2982
- chore(deps): bump axios and wait-on in /site by @dependabot in #2940
- chore(deps-dev): bump ip from 2.0.0 to 2.0.1 by @dependabot in #2939
- chore(deps): bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /site by @dependabot in #2980
- chore(deps): bump follow-redirects from 1.15.3 to 1.15.6 in /site by @dependabot in https://github.com/excaliburjs/Excal...
Excalibur v0.29.1 Release
Small release to fix transition bug!
What's Changed
- fix: Transition bug when camera is zoomed by @eonarheim in #2942
Full Changelog: v0.29.0...v0.29.1
Excalibur v0.29.0 Release
This is a huge release v0.29.0, we have a lot of big features that bring us closer to v1!
Join the community on discord!
There are breaking changes in this release, please review the migration guide from v0.28.x to v0.29.0
Features
-
Added new
ex.Tilemap.getOnScreenTiles()method to help users access onscreen tiles for logic or other concerns. -
Added
ex.FontSourceresource typeconst fontSource = new ex.FontSource('/my-font.ttf', 'My Font') loader.addResource(fontSource) game.start(loader).then(() => { const font = fontSource.toFont() // returns ex.Font })
Font options can be defined either at the source or at the
toFont()call. If defined in both,toFont(options)will
override the options in theFontSource.const fontSource = new ex.FontSource('/my-font.ttf', 'My Font', { filtering: ex.ImageFiltering.Pixel, size: 16, // set a default size }) const font = fontSource.toFont({ // override just the size size: 20, })
-
Added fullscreen after load feature! You can optionally provide a
fullscreenContainerwith a string id or an instance of theHTMLElementnew ex.Loader({ fullscreenAfterLoad: true, fullscreenContainer: document.getElementById('container') });
-
Added new
ex.Debugstatic for more convenient debug drawing where you might not have a graphics context accessible to you. This works by batching up all the debug draw requests and flushing them during the debug draw step.ex.Debug.drawRay(ray: Ray, options?: { distance?: number, color?: Color })ex.Debug.drawBounds(boundingBox: BoundingBox, options?: { color?: Color })ex.Debug.drawCircle(center: Vector, radius: number, options?: ...)ex.Debug.drawPolygon(points: Vector[], options?: { color?: Color })ex.Debug.drawText(text: string, pos: Vector)ex.Debug.drawLine(start: Vector, end: Vector, options?: LineGraphicsOptions)ex.Debug.drawLines(points: Vector[], options?: LineGraphicsOptions)drawPoint(point: Vector, options?: PointGraphicsOptions)
-
Experimental
ex.coroutinefor running code that changes over time, useful for modeling complex animation code. Coroutines return a promise when they are complete. You can think of eachyieldas a frame.- The result of a yield is the current elapsed time
- You can yield a number in milliseconds and it will wait that long before resuming
- You can yield a promise and it will wait until it resolves before resuming
const completePromise = coroutine(engine, function * () { let elapsed = 0; elapsed = yield 200; // frame 1 wait 200 ms before resuming elapsed = yield fetch('./some/data.json'); // frame 2 elapsed = yield; // frame 3 });
-
Added additional options in rayCast options
ignoreCollisionGroupAll: booleanwill ignore testing against anything with theCollisionGroup.Allwhich is the default for allfilter: (hit: RayCastHit) => booleanwill allow people to do arbitrary filtering on raycast results, this runs very last after all other collision group/collision mask decisions have been made
-
Added additional data
sideandlastContacttoonCollisionEndandcollisionendevents -
Added configuration option to
ex.PhysicsConfigto configure composite collider onCollisionStart/End behavior -
Added configuration option to
ex.TileMap({ meshingLookBehind: Infinity })which allows users to configure how far the TileMap looks behind for matching colliders (default is 10). -
Added Arcade Collision Solver bias to help mitigate seams in geometry that can cause problems for certain games.
ex.ContactSolveBias.NoneNo bias, current default behavior collisions are solved in the default distance orderex.ContactSolveBias.VerticalFirstVertical collisions are solved first (useful for platformers with up/down gravity)ex.ContactSolveBias.HorizontalFirstHorizontal collisions are solved first (useful for games with left/right predominant forces)const engine = new ex.Engine({ ... physics: { solver: ex.SolverStrategy.Realistic, arcade: { contactSolveBias: ex.ContactSolveBias.VerticalFirst }, } })
-
Added Graphics
opacityon the Actor constructornew ex.Actor({opacity: .5}) -
Added Graphics pixel
offseton the Actor constructornew ex.Actor({offset: ex.vec(-15, -15)}) -
Added new
new ex.Engine({uvPadding: .25})option to allow users using texture atlases in their sprite sheets to configure this to avoid texture bleed. This can happen if you're sampling from images meant for pixel art -
Added new antialias settings for pixel art! This allows for smooth subpixel rendering of pixel art without shimmer/fat-pixel artifacts.
- Use
new ex.Engine({pixelArt: true})to opt in to all the right defaults to make this work!
- Use
-
Added new antialias configuration options to deeply configure how Excalibur does any antialiasing, or you can provide
antialiasing: true/antialiasing: falseto use the old defaults.- Example;
const game = new ex.Engine({ antialiasing: { pixelArtSampler: false, filtering: ex.ImageFiltering.Pixel, nativeContextAntialiasing: false, canvasImageRendering: 'pixelated' } })
-
Added new
lineHeightproperty onSpriteFontandFontto manually adjust the line height when rendering text. -
Added missing dual of
ex.GraphicsComponent.add(), you can nowex.GraphicsComponent.remove(name); -
Added additional options to
ex.Animation.fromSpriteSheetCoordinates()you can now pass any validex.GraphicOptionsto influence the sprite per frameconst anim = ex.Animation.fromSpriteSheetCoordinates({ spriteSheet: ss, frameCoordinates: [ {x: 0, y: 0, duration: 100, options: { flipHorizontal: true }}, {x: 1, y: 0, duration: 100, options: { flipVertical: true }}, {x: 2, y: 0, duration: 100}, {x: 3, y: 0, duration: 100} ], strategy: ex.AnimationStrategy.Freeze });
-
Added additional options to
ex.SpriteSheet.getSprite(..., options). You can pass any validex.GraphicOptionsto modify a copy of the sprite from the spritesheet.const sprite = ss.getSprite(0, 0, { flipHorizontal: true, flipVertical: true, width: 200, height: 201, opacity: .5, scale: ex.vec(2, 2), origin: ex.vec(0, 1), tint: ex.Color.Red, rotation: 4 });
-
New simplified way to query entities
ex.World.query([MyComponentA, MyComponentB]) -
New way to query for tags on entities
ex.World.queryTags(['A', 'B']) -
Systems can be added as a constructor to a world, if they are the world will construct and pass a world instance to them
world.add(MySystem); ... class MySystem extends System { query: Query; constructor(world: World) { super() this.query = world.query([MyComponent]); } update }
-
Added
RayCastHitas part of every raycast not just the physics world query!- Additionally added the ray distance and the contact normal for the surface
-
Added the ability to log a message once to all log levels
debugOnceinfoOncewarnOnceerrorOncefatalOnce
-
Added ability to load additional images into
ex.Materials!const noise = new ex.ImageSource('./noise.avif'); loader.addResource(noise); var waterMaterial = game.graphicsContext.createMaterial({ name: 'water', fragmentSource: waterFrag, color: ex.Color.fromRGB(55, 0, 200, .6), images: { u_noise: noise } });
-
Scene Transition & Loader API, this gives you the ability to have first class support for individual scene resource loading and scene transitions.
-
Add or remove scenes by constructor
-
Add loaders by constructor
-
New
ex.DefaultLoadertype that allows for easier custom loader creation -
New
ex.Transitiontype for building custom transitions -
New scene lifecycle to allow scene specific resource loading
onTransition(direction: "in" | "out") {...}onPreLoad(loader: DefaultLoader) {...}
-
New async
goToScene()API that allows overriding loaders/transitions between scenes -
Scenes now can have
async onInitializeandasync onActivate! -
New scenes director API that allows upfront definition of scenes/transitions/loaders
-
Example:
Defining scenes upfrontconst game = new ex.Engine({ scenes: { scene1: { scene: scene1, transitions: { out: new ex.FadeInOut({duration: 1000, direction: 'out', color: ex.Color.Black}), in: new ex.FadeInOut({duration: 1000, direction: 'in'}) } }, scene2: { scene: scene2, loader: ex.DefaultLoader, // Constructor only option! transitions: { out: new ex.FadeInOut({duration: 1000, direction: 'out'}), in: new ex.FadeInOut({duration: 1000, direction: 'in', color: ex.Color.Black }) } }, scene3: ex.Scene // Constructor only option! } }) // Specify the boot loader & first scene transition from loader game.start('scene1', { inTransition: new ex.FadeInOut({duration: 500, direction: 'in', color: ex.Color.ExcaliburBlue}) loader: boot, });
- Scene specific input API so that you can add input handlers that only fire whe...
-
Excalibur v0.28.7 Release
Bugfix release! This release is slightly different cut from the branch release/v0.28.x instead of main, this is because features that are not ready to ship are in the mainline currently and will be shipped as part of v0.29.0
- fix: Add friendly error if canvasElementId missing(#2885)
- fix: ex.Material no longer does lazy init, requires graphics context
- fix: Issue with pointer events on screen elements (#2902)
Also big thanks to @jyoung4242! This was his first contribution to Excalibur!
Full Changelog: v0.28.6...v0.28.7
