Join Dennis Meyer for an in-depth discussion in this video Creating text replacement variables, part of Photoshop Variables: Game Production Art.
- The first thing I want to do to this template is to attach some variables to each of the text layers so that I can configure them for each card in my game. To do that, I'm going to come up to the image menu and under variables, I'm going to choose Define. In the Variables window, when Define is selected the very first thing you'll see is a list of layers. This corresponds exactly to the layers and the order of the layers that we see in our layers panel on the right.
What we don't see here, however is what kind of layers those are. In fact, sometimes these are text layers. Sometimes they're raster layers. They could be vector shapes. They could be smart layers. They can even be folders. For that reason, I like to have very clear layer names so that I know exactly the role that that layer is going to be playing. Here, wherever I have a variable that I would like to attach to a layer, I've chosen to put that all in lower case and separate it with underscores.
You can choose to do whatever you like but I would recommend that you have a distinct system so that if you're working in a complex master with dozens or even hundreds of layers, you have a better idea of what's going on. I'm gonna choose planet_name here and now I have the ability to choose which kind of variable type I would like to attach to that layer. We'll talk about visibility in just a minute but I'm gonna go ahead and choose Text Replacement. Now, the variable name itself can be anything I want.
However, I'm going to choose to use the exact same name as the layer. This is gonna help me keep track of things later on. I'm gonna hit this right arrow to choose the next layer which in this case is planet_desc but I'm also going to turn on Text Replacement variable and give the exact same name as the layer so that they match. I'm gonna go ahead and change from Define now to Data Sets. We need to have a data set for every version of the card that we want to produce.
I'm gonna go ahead and choose to create a new data set since we don't have one yet and now I can see that I have a title for the data set. I'm gonna go ahead and give that the name of Epsilon Indi I. Well in this case I, because it's a Roman numeral. I'm gonna choose among the variables planet_name. You'll notice that these don't appear in the order that they appear in the layers. They appear in alphabetical order by their variable name. So choosing planet_name I'm going to again type Epsilon Indi I or I in Roman numerals.
As soon as I hit tab, or select any other interface element, that text is going to be applied to the planet_name layer. This will only happen though if the preview option has been checked. Watch. You'll notice that the layer style is still applied. The only thing that we've replaced is the content of that text layer. Also, it's important to note at this point that the title for the data set never appears inside of your file. It's never going to be visible.
The reason that I've chosen to have Epsilon Indi I match exactly the planet_name is that as I get more and more data sets corresponding to each planet, I wanna be able to find the planet I'm looking for when I'm going through that list. Let's go ahead and modify the planet description now. "A gaseous giant that orbits around "a trinary star system." Now again, as soon as I hit tab that text is going to be inserted into the planet_desc layer.
Let's go ahead and add a second data set. Now this second data set I'm going to call Tau Ceti V for the planet name. Again, I'm going to have that match my data set name exactly for ease of navigation. And for planet_desc "A planet near Earth that was discovered "in the early 21st century." And now our text is updated. Now you'll only see the content change in your master file if the preview option has been selected on the right.
If the preview option has been selected this allows us to rapidly navigate through our cards just by clicking these next and previous data set arrows and it loops as well. This can be a great way to make sure that all of our text fits. Next, I'm gonna come back into Define and I'm gonna create four more variables very quickly for the res_1_text and again, I'm gonna give that a name that matches its layer exactly.
I'm going to do the same for res_2_text for res_3_text, and for res_4_text. Now, when I come back into my data set I can see that I can define those numbers. I've chosen 88 here, because whenever I suspect that a number is going to be one or two digits long I wanna make sure that the area that I have defined around that number is going to accommodate a large number.
Because 8's are full width characters in just about any font you're using, it's a really good placeholder although you can try out other numbers as well. Here, I'm just going to change these numbers really quickly, 1, 1, 2, and 4. And you can see that those update and again because Tau Ceti V is its own data set, when I come over to Epsilon Indi I, it's just going to use the default values that were used in our template until we redefine them. One thing that's important to note is that if Epsilon Indi I doesn't generate any resources, and we don't want that text to be visible, I can't just delete this and tab away.
You'll notice that even though there's nothing listed in the value for the res_4_text variable, it's still appearing on screen. The reason is, if the text is completely blank it's going to treat it as though there's no difference from the default value. If you add a space, however, and tab away it's going to interpret that space and try and render it as text which will take the text away. In some cases, that can be a very useful technique however it only works when you're defining your variables in this variables window.
In this course, Dennis Meyer shows how to create and manage the artwork for an example card game using Photoshop variables. He'll show how to organize a basic template in Photoshop, assign variables for the text and images, and build an external data source in a Google spreadsheet (taking advantage of calculations and other powerful spreadsheet functions). Then he'll show how to load data into the template, export artwork, and make the template available to others.