user3388811
user3388811

Reputation: 358

How To: Kinetic.js cached shape filter

Kinetic.js doc reference tells us following:

cache node to improve drawing performance, apply filters, or create more accurate hit regions

But when i try to cache custom shape and apply some filters to it as following

shape.cache();
shape.filters([Kinetic.Filters.Brighten]); //nothing happens
shape.filterBrightness(100); //this even throws error: Shape doesn't have this method at all

So is there any way to apply some sort of filter/shadow/blur/stroke to cached shape?

Upvotes: 0

Views: 142

Answers (1)

lavrton
lavrton

Reputation: 20323

Look at documantation if you can't find some methods: http://kineticjs.com/docs/

rect.brightness(0.5);

Demo: http://jsbin.com/fucix/1/edit

Upvotes: 1

Related Questions