- 1 Getting Started
- 2 Making your Game
- 3 Exporting your Game
Art Recipes
Use art recipes files to tell Templative how to modify Art using your Content files.
Each component has one to two pieces of art recipes. Usually there is a front art recipe, and a back art recipe. Art Recipes files themselves can be reused across compositions, but it is not atypical for every single composition to have its own art recipes.
Operations
Art Recipes commands are seperated into overlays, style updates, and text replacements.
These operations are done in order, starting with loading the template art file specified at the top. By default, Templative looks for the starter template files in the `/art/templates` folder.
As an example, if we wanted to change the background color to the `teamColor` value of the deck, we could create a style update that finds the element in the art file with the id "background" and set it's `fill` property to the value stored in the `teamColor` field of the deck's component content.
Overlays
Use overlays to layer svg files on top of one another. By default, Templative looks for overlays in the `art/graphicalInserts` directory.
In practice, this means copying the underlying template art file into a new document saved into the graphicInserts directory.
By default, the top left corner of overlay is placed at the top left corner of the template document. But we can also manually specify the position of the top left corner of our overlay. To make sure you like its position, copy the x,y positions of the overlay in the main template file and pass those values to Templative.
Style Updates
Vector art is made up of shapes that have styling applied to them, such as what color it is `fill`'d with. It works very similarly to the CSS styling of html documents.
We use style updates predominantly to change the fill, stroke color, font-size, and size of object in our files. To create a style update, we pick the element we want to change by it's ID (see below), pick which style property we want to change, and then select which value goes in that style property.
Assigning ids in Inkscape
SVG files are simply xml files under the hood. xml is a common "human readable" data format, like JSON. Inkscape provides a useful in app xml editor for our svg files.
Select an object in your art file, note that the corresponding xml element is selected in the xml editor. From here, we can select the id attribute of the element, rename it, and press enter.
Text Replacements
Use text replacements to pipe text data into your art files. Instead of manually writing your content into your art files, instead write {name} in your art file.
Text Replacements within Text Replacements
A text replacement can contain a curly brace wrapped text within it. For instance, the rules value of a piece might be "Upgrade the power by {powerLevel}" which is followed by a text replacement for that powerlevel.
Piping Content into your Art Recipes
In Templative, a singular piece, such as a single poker card, has unique data associated with it. That piece in turn has data associated with it at the component level. It also by extension has access to any data about the game and studio it is a part of.
All of this information is easily accessible within Templative. If I want to set the value of an overlay, style update, or text replacement to a field in the content of the piece, component, game, studio, give the field and the source it's from to Templative.
In this example we pull the name of the game from the `Game` source and the `displayName` field.
See the Content files article for more information on how content works.
Art Recipes Tricks
Inkscape is confusing at first, but once learned is very powerful.
Unique Backs
Rather than make a new component per unique back, Templative is capable of creating new components per unique back in a component. For instance, if a component with 12 cards in it has only three unique faces, but has four unique backColor's, Templative will split this component into four seperate components for you.
Modifying Gradients in Templative
Gradients are handled by seperate xml entities from objects they color. Usually, an object's fill is set to a hexcode like #ffffff. When an object's background is set to a gradient however, the fill is set to the id of the gradient. The seperate gradient object in the svg file has style properties for the beginning and end colors of the gradient.
To modify a gradient from Templative therefore, rather than grabbing the id of the object whose fill is a gradient, we grab the id of the gradient object itself, and manually set the beginning and end stop colors.
With this information, we can set the stop color in Templative:
Modifying drop shadows in Templative works similarly to gradients, can you figure it out?
Didn't get your question answered? Consider posting your question in the Templative Discord in the #troubleshooting chat.