more margins

This commit is contained in:
Kyle
2021-04-16 15:53:53 -07:00
parent 4aef7dfbdc
commit 2a04204262
19 changed files with 65 additions and 43 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -1,3 +1,46 @@
loadFramePacks([
{name:'1/8 Inch Margin', value:'Margin-1'}
])
{name:'Standard 1/8 Inch Margin', value:'Margin-1'},
{name:'Mystical Archive 1/8 Inch Margin', value:'MarginMysticalArchive'}
])
//For multiple Margin packs
const loadMarginVersion = async () => {
//resets things so that every frame doesn't have to
await resetCardIrregularities({canvas:[1500, 2100, 0.044, 1/35], resetOthers:false});
//sets card version
// card.version = 'margin';
card.margins = true;
//art stuff
var changedArtBounds = false;
if (card.artBounds.width == 1) {
card.artBounds.width += 0.044;
changedArtBounds = true;
}
if (card.artBounds.x == 0) {
card.artBounds.x = -0.044;
card.artBounds.width += 0.044;
changedArtBounds = true;
}
if (card.artBounds.height == 1) {
card.artBounds.height += 1/35;
changedArtBounds = true;
}
if (card.artBounds.y == 0) {
card.artBounds.y = -1/35;
card.artBounds.height += 1/35;
changedArtBounds = true;
}
if (changedArtBounds) {
autoFitArt();
}
//runs anything that needs to run
if (card.version.includes('planeswalker')) {
planeswalkerEdited();
}
if (card.version.includes('saga')) {
sagaEdited();
}
drawTextBuffer();
drawFrames();
bottomInfoEdited();
watermarkEdited();
}

View File

@@ -15,46 +15,6 @@ availableFrames = [
//disables/enables the "Load Frame Version" button
document.querySelector('#loadFrameVersion').disabled = false;
//defines process for loading this version, if applicable
document.querySelector('#loadFrameVersion').onclick = async function() {
//resets things so that every frame doesn't have to
await resetCardIrregularities({canvas:[1500, 2100, 0.044, 1/35], resetOthers:false});
//sets card version
// card.version = 'margin';
card.margins = true;
//art stuff
var changedArtBounds = false;
if (card.artBounds.width == 1) {
card.artBounds.width += 0.044;
changedArtBounds = true;
}
if (card.artBounds.x == 0) {
card.artBounds.x = -0.044;
card.artBounds.width += 0.044;
changedArtBounds = true;
}
if (card.artBounds.height == 1) {
card.artBounds.height += 1/35;
changedArtBounds = true;
}
if (card.artBounds.y == 0) {
card.artBounds.y = -1/35;
card.artBounds.height += 1/35;
changedArtBounds = true;
}
if (changedArtBounds) {
autoFitArt();
}
//runs anything that needs to run
if (card.version.includes('planeswalker')) {
planeswalkerEdited();
}
if (card.version.includes('saga')) {
sagaEdited();
}
drawTextBuffer();
drawFrames();
bottomInfoEdited();
watermarkEdited();
}
document.querySelector('#loadFrameVersion').onclick = loadMarginVersion;
//loads available frames
loadFramePack();

View File

@@ -0,0 +1,19 @@
//Create objects for common properties across available frames
var bounds = {x:-0.044, y:-1/35, width:1.088, height:37/35};
//defines available frames
availableFrames = [
{name:'White Extension', src:'/img/frames/mysticalArchive/margin/w.png', bounds:bounds},
{name:'Blue Extension', src:'/img/frames/mysticalArchive/margin/u.png', bounds:bounds},
{name:'Black Extension', src:'/img/frames/mysticalArchive/margin/b.png', bounds:bounds},
{name:'Red Extension', src:'/img/frames/mysticalArchive/margin/r.png', bounds:bounds},
{name:'Green Extension', src:'/img/frames/mysticalArchive/margin/g.png', bounds:bounds},
{name:'Multicolored Extension', src:'/img/frames/mysticalArchive/margin/m.png', bounds:bounds},
{name:'Artifact Extension', src:'/img/frames/mysticalArchive/margin/a.png', bounds:bounds},
{name:'Land Extension', src:'/img/frames/mysticalArchive/margin/l.png', bounds:bounds}
];
//disables/enables the "Load Frame Version" button
document.querySelector('#loadFrameVersion').disabled = false;
//defines process for loading this version, if applicable
document.querySelector('#loadFrameVersion').onclick = loadMarginVersion;
//loads available frames
loadFramePack();