Closed jrock24 closed 7 years ago
Example usage:
_field = new Image(new Texture("field_texture"));
_field.alignPivot();
_gameLayer.addChild(_field);
fieldMask = new TextureMask("field_texture");
fieldMask.alignPivot();
fieldMask.touchable = false;
fieldMask.visible = false;
fieldMask.threshold = .3;
_gameLayer.addChildAt(fieldMask, 0);
card.shadow.mask = _view.fieldMask
This creates a mask the shape of the field texture in order to keep the card shadow only on the field.
Nice! A friend of mine was literally asking me about this missing feature yesterday.
Here's an example with info about the extension: http://wiki.starling-framework.org/extensions/texture_mask
out of curiosity, is there an example of how this is used somewhere?