Gets - or creates - the drawing context
Gets the logical height
Gets the offset x,y
Gets a scaler for size
Gets the logical width
Clears the region of the canvas
Creates a region
Absolute positioned. Uses source coordinates which don't change
source.createRegion({
absPositioned: { x: 0, y: 0, width: 100, height: 100}
});
Relative positioned. Uses coordiantes relative to source dimensions. Updated if source changes.
source.createRegion({
relativePositioned: { x: 0, y:0, width: 1, height: 0.5 },
scale: `independent`
});
Relative sized. Uses size relative to source dimension. By default centers.
source.createRegion({
relativeSize: { width: 0.5, height: 0.5 }
position: `center`
})
Causes drawing context to be re-created
Convert relative to absolute
Converts a rectangle to absolute coordinates
Converts an absolute point to relative
Manges the drawing for a region of a canvas