mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
aftermath + improved text rotation
This commit is contained in:
@@ -922,14 +922,11 @@ function writeText(textObject, targetContext) {
|
||||
if (textRotation) {
|
||||
targetContext.save();
|
||||
targetContext
|
||||
const shapeX = textX + ptShift[0] + permaShift[0];
|
||||
if (!textOneLine) {
|
||||
verticalAdjust *= (textRotation / 180 * -1);
|
||||
}
|
||||
const shapeY = textY + verticalAdjust + ptShift[1] + permaShift[1];
|
||||
const shapeX = textX + ptShift[0];
|
||||
const shapeY = textY + ptShift[1];
|
||||
targetContext.translate(shapeX, shapeY);
|
||||
targetContext.rotate(Math.PI * textRotation / 180);
|
||||
targetContext.drawImage(paragraphCanvas, -canvasMargin, -canvasMargin);
|
||||
targetContext.drawImage(paragraphCanvas, permaShift[0] - canvasMargin, verticalAdjust - canvasMargin + permaShift[1]);
|
||||
targetContext.restore();
|
||||
} else {
|
||||
targetContext.drawImage(paragraphCanvas, textX - canvasMargin + ptShift[0] + permaShift[0], textY - canvasMargin + verticalAdjust + ptShift[1] + permaShift[1]);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
loadFramePacks([
|
||||
{name:'Aftermath (Amonkhet)', value:'Aftermath'},
|
||||
{name:'Flip (Kamigawa)', value:'Flip'},
|
||||
{name:'Future Shifted', value:'FutureRegular'},
|
||||
{name:'Seventh Edition', value:'Seventh'},
|
||||
|
45
js/frames/packAftermath.js
Normal file
45
js/frames/packAftermath.js
Normal file
@@ -0,0 +1,45 @@
|
||||
//Create objects for common properties across available frames
|
||||
// var masks = [{src:'/img/frames/m15/aftermath/pinline.svg', name:'Pinline'}];
|
||||
//defines available frames
|
||||
availableFrames = [
|
||||
{name:'White Frame', src:'/img/frames/m15/aftermath/w.png'},
|
||||
{name:'Blue Frame', src:'/img/frames/m15/aftermath/u.png'},
|
||||
{name:'Black Frame', src:'/img/frames/m15/aftermath/b.png'},
|
||||
{name:'Red Frame', src:'/img/frames/m15/aftermath/r.png'},
|
||||
{name:'Green Frame', src:'/img/frames/m15/aftermath/g.png'},
|
||||
{name:'Multicolored Frame', src:'/img/frames/m15/aftermath/m.png'},
|
||||
{name:'Artifact Frame', src:'/img/frames/m15/aftermath/a.png'},
|
||||
{name:'Land Frame', src:'/img/frames/m15/aftermath/l.png'}
|
||||
];
|
||||
//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() {
|
||||
// Notification
|
||||
notify('At this time, adding the second piece of art is not an option, unless added manually with external software. Apologies for the inconvenience!', 15);
|
||||
//resets things so that every frame doesn't have to
|
||||
await resetCardIrregularities();
|
||||
//sets card version
|
||||
card.version = 'aftermath';
|
||||
//art bounds
|
||||
card.artBounds = {x:0.076, y:0.1124, width:0.848, height:0.2234};
|
||||
autoFitArt();
|
||||
//set symbol bounds
|
||||
card.setSymbolBounds = {x:0.9213, y:0.371, width:0.12, height:0.0410, vertical:'center', horizontal: 'right'};
|
||||
resetSetSymbol();
|
||||
//watermark bounds
|
||||
card.watermarkBounds = {x:0.5, y:0.7762, width:0.75, height:0.2305};
|
||||
resetWatermark();
|
||||
//text
|
||||
loadTextOptions({
|
||||
mana: {name:'Mana Cost', text:'', y:0.0613, width:0.9292, height:71/2100, oneLine:true, size:71/1638, align:'right', shadowX:-0.001, shadowY:0.0029, manaCost:true, manaSpacing:0},
|
||||
title: {name:'Title 1', text:'', x:0.0854, y:0.0522, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381},
|
||||
type: {name:'Type 1', text:'', x:0.0854, y:0.3467, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324},
|
||||
rules: {name:'Rules Text 1', text:'', x:0.086, y:0.4139, width:0.828, height:0.12, size:0.0362},
|
||||
title2: {name:'Title 2', text:'', x:0.92, y:0.5648, width:0.48, height:0.0543, oneLine:true, font:'belerenb', size:0.0381, rotation:90},
|
||||
type2: {name:'Type 2', text:'', x:0.7247, y:0.5648, width:0.48, height:0.3239, oneLine:true, font:'belerenb', size:0.0324, rotation:90},
|
||||
rules2: {name:'Rules Text 2', text:'', x:0.4494, y:0.57, width:0.47, height:0.2715, size:0.0362, rotation:90},
|
||||
});
|
||||
}
|
||||
//loads available frames
|
||||
loadFramePack();
|
@@ -49,10 +49,10 @@ document.querySelector('#loadFrameVersion').onclick = async function() {
|
||||
type: {name:'Type 1', text:'', x:0.0854, y:0.2353, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324},
|
||||
rules: {name:'Rules Text 1', text:'', x:0.086, y:0.102, width:0.828, height:0.12, size:0.0362},
|
||||
pt: {name:'Power/Toughness 1', text:'', x:0.8267, y:0.2448, width:0.0967, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center'},
|
||||
title2: {name:'Title 2', text:'', x:0.9147, y:0.8643, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381, rotation:180},
|
||||
type2: {name:'Type 2', text:'', x:0.9147, y:0.662, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324, rotation:180},
|
||||
rules2: {name:'Rules Text 2', text:'', x:0.914, y:0.82, width:0.828, height:0.12, size:0.0362, rotation:180},
|
||||
pt2: {name:'Power/Toughness 2', text:'', x:0.1734, y:0.6739, width:0.0967, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center', rotation:180}
|
||||
title2: {name:'Title 2', text:'', x:0.9147, y:0.8848, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0381, rotation:180},
|
||||
type2: {name:'Type 2', text:'', x:0.9147, y:0.6886, width:0.8292, height:0.0543, oneLine:true, font:'belerenb', size:0.0324, rotation:180},
|
||||
rules2: {name:'Rules Text 2', text:'', x:0.914, y:0.821, width:0.828, height:0.12, size:0.0362, rotation:180},
|
||||
pt2: {name:'Power/Toughness 2', text:'', x:0.1734, y:0.6791, width:0.0967, height:0.0372, size:0.0372, font:'belerenbsc', oneLine:true, align:'center', rotation:180}
|
||||
});
|
||||
}
|
||||
//loads available frames
|
||||
|
Reference in New Issue
Block a user