plugin-card-layers
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| plugin-card-layers [2024/12/03 10:50] – [Refreshing] banerjeesw | plugin-card-layers [2025/06/27 22:41] (current) – [Badge Notetags] isiahgames | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| This plugin allows you to control the appearance of cards through a layer system. This allows the addition of Layers and Badges. | This plugin allows you to control the appearance of cards through a layer system. This allows the addition of Layers and Badges. | ||
| - | Layers are image components that have a Priority value which determines the order in which they appear, with the lowest value being the farthest back and the highest being the farthest in front. | + | Layers are image components that have a **Priority** value which determines the order in which they appear, with the lowest value being the farthest back and the highest being the farthest in front. |
| + | | **Back** | ||
| + | | **Base** | ||
| + | | **Art** | ||
| + | | **Text** | ||
| + | | **Highlight** | ||
| - | Default Layers have the following Priorities: | ||
| - | < | ||
| - | Back - 0 | ||
| - | Base - 100 | ||
| - | Art - 200 | ||
| - | Text - 300 | ||
| - | Highlight - 400 | ||
| - | </ | ||
| Any Custom Layer added will have Priority values between these. So for instance if you have a Custom Layer with a Priority of 250 it will appear above the Art layer but behind the Text layer. | Any Custom Layer added will have Priority values between these. So for instance if you have a Custom Layer with a Priority of 250 it will appear above the Art layer but behind the Text layer. | ||
| Line 23: | Line 20: | ||
| ===== Layer Properties ===== | ===== Layer Properties ===== | ||
| - | Layers | + | Card Art Layer elements |
| - | + | ||
| - | **Name** - The name of the Layer. | + | |
| - | + | ||
| - | **Priority** - A number representing the order of all Layers in the Card. Higher number means farther in front. | + | |
| - | + | ||
| - | **Image** - The image of the Layer, located in img/ | + | |
| - | + | ||
| - | **Position Offset** - The offset position of the Layer. | + | |
| - | **Condition** | + | | **Name** |
| + | | **Priority** | ||
| + | | **Image** | ||
| + | | **Position Offset** | ||
| + | | | ||
| ===== Default Layers ===== | ===== Default Layers ===== | ||
| Line 40: | Line 33: | ||
| Back and Base images are located in img/ | Back and Base images are located in img/ | ||
| - | **Back** | + | | |
| - | + | | | |
| - | If the Back's image is set to " | + | | |
| - | + | | | |
| - | 1. If it has a Card Type that has a Card Back parameter, it will use that. | + | | |
| - | + | ||
| - | 2. Else it will use DefaultBack.png | + | |
| - | + | ||
| - | **Base** | + | |
| - | + | ||
| - | The Base determines the dimensions of the card for purposes of placing any other layer components and for touch input hitboxes. | + | |
| - | + | ||
| - | If its image is set to " | + | |
| - | + | ||
| - | 1. If it has a <Card Base: fileName> | + | |
| - | + | ||
| - | 2. If it has a Card Type that has a Card Base parameter, it will use that. | + | |
| - | + | ||
| - | 3. Else it will use Default.png | + | |
| - | + | ||
| - | **Art** | + | |
| - | + | ||
| - | If its image is set to " | + | |
| - | + | ||
| - | 1. If it has a <Card Art: fileName> | + | |
| - | + | ||
| - | 2. Else it will use the skill' | + | |
| - | + | ||
| - | **Text** | + | |
| - | + | ||
| - | This Default Layer does not have an image component because it is designed to be an empty canvas on which the text is written. | + | |
| - | + | ||
| - | **Highlight** | + | |
| This Default Layer also does not have an image component because Cards contain multiple highlights at once to ensure a smooth transition between states of highlight. This Layer represents all Highlights. | This Default Layer also does not have an image component because Cards contain multiple highlights at once to ensure a smooth transition between states of highlight. This Layer represents all Highlights. | ||
| Line 101: | Line 66: | ||
| </ | </ | ||
| - | **LayerName** | + | | |
| - | + | | **Priority** | |
| - | **Priority** | + | | **ImageName** |
| - | + | | **X** | The new X offset | |
| - | **ImageName** | + | | **Y** | The new Y offset |
| - | + | | **Condition** | |
| - | **X** - The new X offset | + | |
| - | + | ||
| - | **Y** - The new Y offset | + | |
| - | + | ||
| - | **Condition** | + | |
| Each one of these components are optional. If a component is not present the Layer will use the default values defined through plugin parameters. The | dividers are still neccessary to override a later property if you aren't overriding an early one. | Each one of these components are optional. If a component is not present the Layer will use the default values defined through plugin parameters. The | dividers are still neccessary to override a later property if you aren't overriding an early one. | ||
| Line 147: | Line 107: | ||
| ===== Badges ===== | ===== Badges ===== | ||
| - | Badges are special components that have an image property and a text property. | + | Badges are special components that have an image property and a text property. |
| - | Badges have the following properties: | + | | **Name** | The name of the Badge. | |
| + | | **Priority** | A number representing the order of all Elements in the Card. Higher number means farther in front. | | ||
| + | | **Image** | The image of the Badge, located in img/ | ||
| + | | **Position Offset** | The offset position of the Badge. | | ||
| + | | **Text** | A code expression that evaluates into text. More about that below. | | ||
| + | | **Font Settings** | | | ||
| + | | //Font Face// | The font for the text to use. Use GameFont for the project' | ||
| + | | //Font Size// | The font size for the text. | | ||
| + | | **Text Color** | A hexcode for the text color, though certain color | | ||
| - | **Name** - The name of the Badge. | + | ===== Badge Text ===== |
| - | **Layer Name** - The Layer the Badge is attached | + | The Text property |
| - | **Image** | + | "Hello World!" |
| - | **Position Offset** - The offset position | + | instead |
| - | **Text** | + | Hello World! |
| - | **Font Settings** - | + | This property is code so that it can display variables more easily. |
| - | //Font Face// - The font for the text to use. Use GameFont for the project' | + | Example: |
| + | < | ||
| + | user.mp + " MP" | ||
| + | </code> | ||
| - | //Font Size// - The font size for the text. | + | This example would display "3 MP" while the owner of the card had 3 MP. |
| - | **Text Color** - A hexcode for the text color, though certain color | + | There are three variables you can use in the Text property to make referencing variables you want easier. |
| - | ===== Badge Text ===== | + | < |
| + | user - The Actor that owns the card. | ||
| + | card - The Card object itself. | ||
| + | skill - The Skill that the Card is a copy of. | ||
| + | </ | ||
| + | Examples of how you might use these: | ||
| + | |||
| + | < | ||
| + | "LVL " + user.level | ||
| + | card.origin().toUpperCase() | ||
| + | skill.mpCost | ||
| + | </ | ||
| + | |||
| + | If you're using MYTH_CGC_IndependantCardVariables you can use: | ||
| + | < | ||
| + | card.cardVar(1) | ||
| + | </ | ||
| + | |||
| + | ===== Badge Notetags ===== | ||
| + | |||
| + | Badge notetags work similarly to Layer notetags and use the following syntax: | ||
| + | |||
| + | < | ||
| + | BadgeName (Priority): TextCode | ImageName | X Y | Condition | ||
| + | </ | ||
| + | |||
| + | | **BadgeName** | ||
| + | | **Priority** | A number from 1 to 500 that overrides the default Priority of the badge. | | ||
| + | | **TextCode** | The code that returns the text for the Badge to display. | | ||
| + | | **ImageName** | The name of the image file to use for the Badge. Can have spaces. | | ||
| + | | **X** | The new X offset | | ||
| + | | **Y** | The new Y offset | | ||
| + | | **Condition** | The new condition for the Badge. | | ||
| + | |||
| + | Just like with Layers, you can use notetags to define entirely new Badges or override the values defined through the Custom Badges plugin parameter. | ||
| ===== Conditions ===== | ===== Conditions ===== | ||
| + | The Condition property determines whether a Layer or Badge is visible. If it returns true, the component is visible, and if it returns false it is invisible. | ||
| + | |||
| + | Note that because Badges are attached to Layers, if a Badge' | ||
| + | |||
| + | Just like with Badge Text, you have three variables you can use to make this evaluation more flexible: | ||
| + | < | ||
| + | user - The Actor that owns the card. | ||
| + | card - The Card object itself. | ||
| + | skill - The Skill that the Card is a copy of. | ||
| + | </ | ||
| ===== Refreshing ===== | ===== Refreshing ===== | ||
plugin-card-layers.1733219437.txt.gz · Last modified: 2024/12/03 10:50 by banerjeesw