Skip to content

Upgrade from 1.x to 2.0 ​

Yugioh Card 2.0 revises the card data fields. Update constructor data, calls to setData(), and stored JSON together. This guide uses 1.9.2 as the baseline. yugioh-card 1.9.2

Before and after ​

This is a partial data object for a monster card. Segment numbers start at 1 and follow newlines in cardText.

diff
- { "description": "A demo monster.", "image": "/dragon.png", "scale": 1,
-   "firstLineCompress": true, "descriptionAlign": false }
+ { "cardText": "A demo monster.", "artwork": "/dragon.png", "renderScale": 1,
+   "compressCardTextSegments": [1], "cardTextAlign": "justify" }

Field mapping ​

All cards ​

1.x2.0
scalerenderScale
radiusroundCorners

Cards with artwork ​

1.x2.0
imageartwork

Yu-Gi-Oh!, Rush Duel, and Series 2 ​

1.x2.0
colornameColor
typecardLayout
iconspellTrapIcon
cardTypemonsterFrame
monsterTypemonsterTypeLine
descriptioncardText
descriptionZoombodyTextFontSizeScale
descriptionWeightbodyTextStrokeWidth
packagecardNumber
lasercornerMark
firstLineCompress: true / falsecompressCardTextSegments: [1] / []
descriptionAlign: true / falsecardTextAlign: 'center' / 'justify'

Yu-Gi-Oh! and Series 2 ​

1.x2.0
alignnameTextAlign
gradientapplyNameGradient
gradientColor1nameGradientColor1
gradientColor2nameGradientColor2
copyrightcopyrightLanguage
fonttextStylePreset

Yu-Gi-Oh! ​

1.x2.0
pendulumTypependulumFrame
pendulumDescriptionpendulumEffect
atkBarshowBattleStats
arrowListlinkArrows
rarerarity
twentiethshow20thAnniversaryMark

Rush Duel ​

1.x2.0
legendshowLegendMark
rarerarity

Yu-Gi-Oh! Card Back ​

1.x2.0
typebackDesign
logogameLogo
konamishowKonamiLogo
registershowRegisteredMark

Field Center Card ​

1.x2.0
cardBackrenderBackSide

Value and rendering changes ​

Use linkArrows in place of arrowList. The Link Rating counts unique valid directions. Duplicate positions in older data can produce a different rating in 2.0.

cardTextAlign also accepts 'left' and 'right'. Set compressCardTextSegments: [1, 3] to fit the first and third segments on one line each.

Remove rare from Series 2 data. You can keep password in stored Rush Duel data.

Check the upgrade ​

  1. Install the 2.0 package and update the static assets at resourcePath to the corresponding version, including the new ygo-jp.woff2.
  2. Convert stored JSON and check the fields and enums in the API reference. Choose the mapping for the original class. For example, type refers to different options on card fronts and card backs.
  3. In both the browser and Node.js, read and await card.ready after each setData() call, then export. Use the Node.js example to check batch exports.
  4. Re-export representative cards. Check line wrapping and dimensions on Japanese ruby text, longer card text, and Link Monsters.