0.1.14 • Published 4 years ago

vue-easeljs v0.1.14

Weekly downloads
103
License
MIT
Repository
github
Last release
4 years ago

Custom filters

Create new filters by registering a class with the VueEaseljs library at runtime using the VueEaseljs.registerFilter method.

Parameter
namethe name for the filter
Filterthe class that filters

When the filter is used in an element's filters prop, the extra values are passed to the filter's constructor method.

The filter should have one of two methods: either adjustContext or adjustImageData.

adjustContext

Parameter
ctxa CanvasRenderingContext2D that contains the visual element
xthe x coordinate of the element on ctx
ythe y coordinate of the element on ctx
widththe width of the element on ctx
heightthe height of the element on ctx
targetCtxthe CanvasRenderingContext2D to draw to, if absent, use ctx
targetXthe x coordinate to draw to, if absent, use x
targetYthe y coordinate to draw to, if absent, use y

This method should make changes to the data in ctx and write them to targetCtx if present, or else back to ctx.

This method must return true if it succeeded.

adjustImageData

Parameter
imageDataan ImageData object

This method should make changes directly to the imageData object.

This method must return true if it succeeded.

Example:

const VueEaseljs = require('vue-easeljs');

class MyFilter {

    constructor(value1, value2) {
        ...
    }

    adjustContext(ctx, x, y, width, height, targetCtx, targetX, targetY) {
        ...
    }
}

VueEaseljs.registerFilter('MyFilter', MyFilter);
0.1.14

4 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

7 years ago

0.1.0

7 years ago