gama avatar

Cazicanvas 1.1

gama

Published: 08 Feb 2018 › Updated: 08 Feb 2018Cazicanvas 1.1

Cazicanvas 1.1

cazicanvas 1.1.png

I'm introducing the new Cazicanvas 1.1 which has a new feature.
By calling the function iterateLine, given 2 points, you will get all the points between them without leaving empty spaces. This can be used for custom brushes and PixelArt editors.

I give you an example

cx.iterateLine(100, 100, 150, 175, function(x, y) {
    cx.fillCircle(x, y, 5);
})

This example will draw a circle of a radius of 5 in every pixel between x1, y1 and x2, y2.

The result...
You_re_gonna_carry_that_wheight_.png

I know the result is very simple, but if you tune up the scale:

var scale = 0.1;
cx.iterateLine(100 * scale, 100 * scale, 150 * scale, 175 * scale, function(x, y) {
    cx.fillRect(x / scale, y / scale, 10, 10);
})

You_re_gonna_carry_that_wheight_.png

This makes more sense, but still you will need to be more creative to find better ways to use it.

Happy Graphics!

Leave Cazicanvas 1.1 to:

Written by

Read more #canvas posts


Best Posts From gama

We have not curated any of gama's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From gama