Releases: straker/kontra
Releases · straker/kontra
v7.1.0
v7.0.0
Breaking Changes
Sprite
- When drawing a sprite, the sprite has now been translated to the proper location to start drawing the sprite. You should use
0, 0
to start drawing instead ofthis.x, this.y
.
- this.context.fillRect(this.x, this.y, this.width, this.height);
+ this.context.fillRect(0, 0, this.width, this.height);
- Removed support for flipping an image using a negative width/height. Use the new
setScale
to set the scale to a negative value to flip. viewX
andviewY
removedcollidesWith
removed. Use the newkontra.collides
helper function
keyboard
- Removed support for KeyboardEvent.keycode as KeyboardEvent.code now works in all major browsers
pointer
- Removed
kontra.pointer
. Use the newkontra.getPoiner
.
Vector
add
no longer accepts thedt
parameters. Use the newVector.scale
function to scale a vector.
Features
- Support to remove code inside Classes through rollup-plugin-kontra.
- typescript support
Assets
- Support for
.wav
files
Button
Button is a new component which allows you to create accessible Buttons for your game.
GameLoop
- pass
canvas
to change which canvas is cleared.
GameObject
GameObject is a new parent class for Sprite and handles most rendering functionality. You should continue to use Sprite as you do today. New features include:
opacity
supportscaleX
,scaleY
, andsetScale
for scale supportworld
for getting the world position, size, opacity, scale, and rotationchildren
,parent
,addChild
, andremoveChild
for grouping support
Grid
Grid is a new component which helps you easily create UI menus by auto-placing objects into a grid.
Helpers
A group of helpful functions.
kontra.degToRad
kontra.radToDeg
kontra.angleToTarget
kontra.rotatePoint
kontra.randInt
kontra.seedRand
kontra.lerp
kontra.inverseLerp
kontra.clamp
kontra.setStoreItem
kontra.getStoreItem
kontra.collides
pointer
kontra.initPointer
returns the pointer object- can now work with multiple canvases by passing the canvas to
initPointer
andgetPointer
Scene
Scene is a new component to organize the differnet parts of your game
Text
Text is a new component to write text to the canvas
Vector
Vector.angle
Vector.clamp
Vector.distance
Vector.dot
Vector.length
Vector.normalize
Vector.scale
Vector.subtract
v6.9.1
fix(tileEngine): don't error for object layers @andre-lima
v6.9.0
- feat(pointer): add multi-touch support @crhallberg
- fix(tileEngine): rerender individual dirty layers @FabricioK
v6.8.0
v6.7.1
fix(pool): improved pool performance @crhallberg