CanvasConverse Documentation
April 20, 2025 ยท View on GitHub
(Generated from generateDocumentation.js to clipboard - 2025/04/20th.)
Methods
constructor(/** still need to call init */)
init(canvas, options = { h: 0, w: 0 })
rectangle({
x,
y,
w,
h,
rotation = 0 /* degrees */,
rotationX /* x position of rotation */,
rotationY /* y position of rotation */,
cornerRadii /* https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/roundRect */,
fill,
stroke,
lineWidth,
filter,
physics,
outlineGroup = "",
addObject = true,
})
triangle({
x1,
y1,
x2,
y2,
x3,
y3,
rotation = 0 /* degrees */,
rotationX /* x position of rotation */,
rotationY /* y position of rotation */,
fill,
stroke,
lineWidth,
filter,
physics,
outlineGroup = "",
addObject = true,
})
ellipse({
x,
y,
r,
rx,
ry,
fill,
stroke,
lineWidth,
filter,
centerRotation = 0 /* degrees */,
centerStartAngle = 0 /* degrees */,
centerEndAngle = 360 /* degrees */,
rotation = 0 /* degrees */,
rotationX /* x position of rotation */,
rotationY /* y position of rotation */,
counterclockwise = false,
physics,
outlineGroup = "",
addObject = true,
})
line({
x1,
y1,
x2,
y2,
lineWidth,
stroke,
filter,
rotation = 0 /* degrees */,
rotationX /* x position of rotation */,
rotationY /* y position of rotation */,
lineCap,
physics,
outlineGroup = "",
addObject = true,
})
draw({
x,
y,
rotation = 0 /* degrees */,
rotationX /* x position of rotation */,
rotationY /* y position of rotation */,
fill,
filter,
physics,
outlineGroup = "",
addObject = true,
},
callbackWithContext,)
group(objectToAttachTo, arrayOfObjectsToAttach = [])
makeOutlineGroup({
drawShapesCallback,
stroke,
fill,
lineWidth,
filter,
outlineGroupKey,
})
text({
text,
x = 0,
y = 0,
font,
type,
style,
baseline = "top",
rotation = 0 /* degrees */,
rotationX /* x position of rotation */,
rotationY /* y position of rotation */,
scale /* e.g.: [-1, 1] to flip horizontally */,
addObject = true,
})
clear()
Properties
usingOutlineGroup: boolean
outlineGroups: object
objects: object
NaivePhysics Documentation
(Generated from generateDocumentation.js to clipboard - 2025/04/20th.)
Methods
constructor(canvasConverse)
Properties
canvasConverse: object
objects: undefined
canvas: undefined
context: undefined
bounceCoefficient: number
collisionCoefficient: number
gravityCoefficient: number