今回からまた新たなお題を、EaselJSサイトのデモから頂戴しよう。「ALPHAMASK FILTER」というサンプルで、アルファチャネルのマスクが動的につくられる(図1)。EaselJSのDisplayObjectインスタンスには、Shapeオブジェクトでベクターマスクがかけられる(DisplayObject.maskプロパティ)。アルファマスクは、ベクターマスクとは異なり、AlphaMaskFilterクラスで扱われるフィルタだ。「ALPHAMASK FILTER」では、さらにBoxBlurFilterクラスで、インスタンスのイメージにぼかしを加えている。今回は、まずこのふたつのフィルタの使い方を学ぼう。 図1 EaselJSサイトのデモ「ALPHAMASK FILTER」 外部画像ファイルから読込んだイメージをインスタンスにしてステージに置く フィルタをかけるには、ステー