4000.0.0-alpha.23
[4000.0.0-alpha.23] - 2025-11-05
Added
-
Added
getGamepadAnalogButton()to read the analog value of buttons like the
triggers - @dragoncoder047isGamepadButtonDown("rtrigger"); // -> true/false, 0/1 getGamepadAnalogButton("rtrigger"); // -> analog value between 0 (not pressed) and 1 (fully pressed)
-
Added chorded button bindings using the Buttons API, so you can bind different
actions totabandshift+tab, and handle them like normal. Also works with
gamepads and mouse! - @dragoncoder047kaplay({ buttons: { forward: { keyboard: "tab", gamepad: "south", }, backward: { keyboard: "shift+tab", gamepad: "rshoulder+south", }, }, });
-
Added
skewto text formatting, so now italics is possible - @dragoncoder047 -
Added lifetime scopes, a way to define the lifetime of an event handler
using a specific scope,scene,appor a game object - @lajbel,
@dragoncoder047app.onUpdate(() => { // runs until it is cancelled }); scene("game", () => { const obj = add([]); obj.onUpdate(() => { // runs until obj is destroyed }); scene.onUpdate(() => { // or just onUpdate(() => { // runs until scene is changed }); });
All the available handlers in the scopes are
GameEventHandlersones:onKeyDown()onKeyPress()onKeyPressRepeat()onKeyRelease()onCharInput()onMouseDown()onMousePress()onMouseRelease()onMouseMove()onScroll()onTouchStart()onTouchMove()onTouchEnd()onGamepadConnect()onGamepadDisconnect()onGamepadButtonDown()onGamepadButtonPress()onGamepadButtonRelease()onGamepadStick()onButtonDown()onButtonPress()onButtonRelease()onTabHide()onTabShow()
And this game object handlers may differ when using it with
objand
scene/app:onFixedUpdate()onUpdate()onDraw()
-
Added
appscope for app event handlers - @lajbelapp.onUpdate(() => { // runs until it is cancelled });
-
Added
KAPLAYOpt.defaultLifetimeScopefor setting the default lifetime scope
used for event handlers - @lajbelkaplay({ defaultLifetimeScope: "app", // default is "scene" }); onKeyPress("space", () => { // runs until is cancelled });
-
Added
skewto text formatting, so now italics is possible - @dragoncoder047
Changed
-
(!) Renamed
onShow()toonTabShow()andonHide()toonTabHide()-
@lajbel -
In addition to being the
scene()function, nowsceneis also a scope for
scene event handlers - @lajbelscene("game", () => { scene.onUpdate(() => { // or just onUpdate(() => { // runs until scene is changed }); });
Fixed
- Now
pushScene()andpopScene()give the arguments to the scene in the same
way thatgo()does rather than passing them all to the first argument as an
array - @dragoncoder047 - Fixed a flicker due to the fadeIn not setting opacity until the next frame -
@mflerackers - Fixed FPS cap not working correctly - @mflerackers, @dragoncoder047
Full Changelog: 4000.0.0-alpha.22...4000.0.0-alpha.23