Templating Tips: Masks

Templating Tips: Masks

Staff Articles:
Templating Tips: Masks
Written by Art_Freak

•When it comes to template design and layout nothing can be more perplexing than a complex card design that features...
...blended sections of a card... ...a curved textbox... ...or a curved mana cost...
...or any other complex or frustrating element like the ones above. MSE2 allows us to make these things possible with, believe it or not, an image. This image is a PNG file called a "mask" and is called by the appropriate card field in thestyle file. To understand a mask, consider one you might wear on your face: you can't see through the solid areas, and nothing gets through. The same principle is in effect here...
...nothing goes through black, and anything can pass through white.
The masks sampled above are the same masks that make the features in the first three images possible for MSE2 to recreate. Images in MSE2 are surprisingly powerful, and a mask can even feature gradient areas (areas ranging from white to gray to black) that allow things like hybrids in Magic: The Gathering.
The above shows how MSE2 uses masks to create a hybrid card.
Masks don't stand alone though, or in other words, you can't just drop a mask in a folder with the rest of the template files and expect MSE2 to know what to do with it. In the style file you'll now have to call the appropriate mask or masks as mentioned earlier. For example, if you want to call the mask that curves the textbox on a VS System card, you would add the following to the rule text card field in the style file:
		mask: text-mask.png
Once that code is in place and the mask is in the template's folder, any text you type into the rule text card field will now determine the shape of that field based on that mask. In program, with fields visible, you will see a straight line indicating the general shape of the field. Don't mistake this for the true shape of the field, as field shapes are not rendered with curved lines. The curve is still in effect.

In addition to all of this, advanced scripting can be combined with mask images to create color fields of unique shapes, (such as the border on Magic Planeswalker cards), or semi-transparent imagery, glow effects, and much more. I won't be covering any advanced scripting today, maybe in the future, but not today. What I wanted to do today was touch base on just what masks are, what they can do, and their overall versatility. I hope I've accomplished that, that this helps clarify just what masks are and how they work, and that this has shed some light on how a simple image can make just about anything possible.
Tue, 2010-12-21 05:44
Art_Freak's picture

Feel free to reply to this page and share your thoughts on the article. A happy smile

Wed, 2011-04-13 03:05

Thank you for the explanation. I learned quite a bit from it Big smile

I understand how masks affect the placement of text, but could inputted text affect the exact placement of colors/blends? I ask because I got this idea of throwing a field behind the casting cost which displayed a bar representing the color weight. The best way I can explain it is that it would kinda look like a gradated life bar from a fighting games. If you had a 3RWW, for example, it would be yellow behind the white mana symbols, phase to red, and then to gray by the time it reached the "3". The gray would then stretch for 2 more spaces after the cost (shorthand: 1/2 gray; 1/6 red; 1/3 white).

Admittedly it may be a superfluous addition and a pain to script in, but I would still like to know if it is possible.

Tue, 2015-02-24 19:17
PhantomBlaster's picture

where do you go to create cards

Sat, 2015-07-04 22:23

Well what if I want my mask to be white and opaque? You said anything can pass through white.