Kaboom.js v2001.0.0 Release Notes
-
- brought back
loadMark()
- (BREAK) removed all deprecated functions in v2000.2
- game objects can have children with
obj.add()
now which share the parent transform - (BREAK) raised esbuild target to
esnext
- ➕ added
make()
to make a game object without adding to the scene - ➕ added support for
add()
to add unattached game objects to the sceneadd(make([...comps]))
- ➕ added
colors
option todrawPolygon()
that controls the color of each corner - ➕ added
gradient
option todrawRect()
that specifies the start and end color - ➕ added
loadProgress()
that returns a0.0 - 1.0
that indicates current asset loading progress - ➕ added
kaboom()
optionloadingScreen
where you can turn off the default loading screen - ➕ added
drawMasked()
anddrawSubtracted()
- (BREAK) removed
layers()
in favor of parent game objects (see "layers" demo) - ➕ added
pushRotateX()
,pushRotateY()
andpushRotateZ()
- ➕ added
pixelDensity
option tokaboom()
- ➕ added support for non bitmap fonts
- (BREAK) rename
loadFont()
toloadBitmapFont()
- ➕ added
loadFont()
to load.ttf
,.otf
,.woff2
or any font supported by browserFontFace
- (BREAK)
origin
no longer controls text alignment, usealign
option instead - ➕ added
quit()
to end everything - 🔊 shader error logs now yields the correct line number
- ⚡️ changed object update order from reversed to not reversed
- ➕ added
download()
,downloadText()
,downloadJSON()
,downloadBlob()
- ➕ added
Recording#stop()
to stop the recording and returns the video data as mp4 Blob - ➕ added
debug.numFrames()
to get the total number of frames elapsed - 🛠 fixed visual artifacts on text
- ➕ added
onError()
to handle error or even custom error screen - ➕ added
onLoading()
to register a custom loading screen (see "loader" example) - 🛠 fixed touches not treated as mouse
- (BREAK) changed
onTouchStart()
,onTouchMove()
andonTouchEnd()
callback signature to(pos: Vec2, touch: Touch) => void
(exposes the nativeTouch
object) - ➕ added
onResize()
to register an event that runs when canvas resizes - (BREAK)
GameObj#_id
has been renamed toGameObj#id
- (BREAK) removed
load()
event for components, useonLoad()
inadd()
event - (BREAK) renamed
Body#onFall()
toBody#onFallOff()
which triggers when object fall off a platform, addedBody#onFall()
which fires when object starts falling - (BREAK)
addLevel()
now returns aGameObj
which has all individual grid objects as its children game objects, withLevelComp
containing its previous methods - (BREAK) defining
gravity()
is now required for enabling gravity,body()
by default will only prevent objects from going through each other, removedsolid()
in favor ofbody({ isStatic: true })
- (BREAK) renamed
Body#weight
toBody#gravityScale
- (BREAK) removed
GameObj#every()
andGameObj#revery()
in favor ofobj.get().forEach()
- ➕ added
GameObj#getAll()
for recursively getting children game objects (get()
only gets from direct children) - ➕ added
Area#onCollisionActive()
andArea#onCollisionEnd()
events - ✂ removed
debug.objCount()
in favor ofgetAll().length
- ➕ added
debug.numFrames()
to get the current frame count - (BREAK) renamed
cursor()
tosetCursor()
- (BREAK) renamed
fullscreen()
tosetFullscreen()
- 🚚 moved type defs for global functions to
import "kaboom/global"
- (BREAK) removed
apl386
andapl386o
as default fonts, default font changed tosink
,, and added a default font size of16
- brought back