SHARE
TWEET

Untitled

a guest May 25th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package hcmair.starling.filters
  2. {
  3.     import hcmair.starling.effects.ColorMaskEffect;
  4.    
  5.     import starling.filters.FragmentFilter;
  6.     import starling.rendering.FilterEffect;
  7.  
  8.     public class ColorMaskFilter extends FragmentFilter
  9.     {
  10.         public function ColorMaskFilter(color:uint = 0xFFFFFF):void
  11.         {
  12.             colorOffsetEffect.maskColor = color;
  13.         }
  14.  
  15.         override protected function createEffect():FilterEffect
  16.         {
  17.             return new ColorMaskEffect();
  18.         }
  19.  
  20.         private function get colorOffsetEffect():ColorMaskEffect
  21.         {
  22.             return effect as ColorMaskEffect;
  23.         }
  24.  
  25.         public function get maskColor():uint { return colorOffsetEffect.maskColor; }
  26.         public function set maskColor(value:uint):void
  27.         {
  28.             colorOffsetEffect.maskColor = value;
  29.             setRequiresRedraw();
  30.         }
  31.     }
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top