Styling elements of a 'stock' collection
Posted: 12 February 2013, 05:26
I'm using a stock collection to show players a set of cards. I want to indicate that some of the cards are not playable.
I've tried to do this by manipulating the opacity values or changing the border color, but the stock collection object already manipulates these values when it does animations or selections, so it overwrites what I set.
I have something that looks great using HTML 5 filter effects, which means they don't conflict with anything set by the stock objects... but only a limited number of browsers support this. (Specifically, I'm setting -webkit-filter: sepia(1) opacity(0.5)... this really makes the unselectable cards fade into the background!)
I could simulate this effect by building a second version of my sprite image that has effects pre-applied, and simply swapping the "src" of the image to the alternate version when I want to apply the filter. Is this the best way to do it?
- Brian
I've tried to do this by manipulating the opacity values or changing the border color, but the stock collection object already manipulates these values when it does animations or selections, so it overwrites what I set.
I have something that looks great using HTML 5 filter effects, which means they don't conflict with anything set by the stock objects... but only a limited number of browsers support this. (Specifically, I'm setting -webkit-filter: sepia(1) opacity(0.5)... this really makes the unselectable cards fade into the background!)
I could simulate this effect by building a second version of my sprite image that has effects pre-applied, and simply swapping the "src" of the image to the alternate version when I want to apply the filter. Is this the best way to do it?
- Brian