mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 13:21:41 -05:00
roll box color
This commit is contained in:
@@ -952,6 +952,7 @@ function writeText(textObject, targetContext) {
|
|||||||
var manaPlacementCounter = 0;
|
var manaPlacementCounter = 0;
|
||||||
var realTextAlign = textAlign;
|
var realTextAlign = textAlign;
|
||||||
savedRollYPosition = null;
|
savedRollYPosition = null;
|
||||||
|
var savedRollColor = 'black';
|
||||||
var drawToPrePTCanvas = false;
|
var drawToPrePTCanvas = false;
|
||||||
var widestLineWidth = 0;
|
var widestLineWidth = 0;
|
||||||
//variables that track various... things?
|
//variables that track various... things?
|
||||||
@@ -1120,6 +1121,8 @@ function writeText(textObject, targetContext) {
|
|||||||
ptShift[0] = scaleWidth(parseFloat(possibleCode.replace('ptshift', '').split(',')[0]));
|
ptShift[0] = scaleWidth(parseFloat(possibleCode.replace('ptshift', '').split(',')[0]));
|
||||||
ptShift[1] = scaleHeight(parseFloat(possibleCode.split(',')[1]));
|
ptShift[1] = scaleHeight(parseFloat(possibleCode.split(',')[1]));
|
||||||
}
|
}
|
||||||
|
} else if (possibleCode.includes('rollcolor')) {
|
||||||
|
savedRollColor = possibleCode.replace('rollcolor', '') || 'black';
|
||||||
} else if (possibleCode.includes('roll')) {
|
} else if (possibleCode.includes('roll')) {
|
||||||
drawTextBetweenFrames = true;
|
drawTextBetweenFrames = true;
|
||||||
redrawFrames = true;
|
redrawFrames = true;
|
||||||
@@ -1247,7 +1250,7 @@ function writeText(textObject, targetContext) {
|
|||||||
if (savedRollYPosition != -1) {
|
if (savedRollYPosition != -1) {
|
||||||
paragraphContext.globalCompositeOperation = 'destination-over';
|
paragraphContext.globalCompositeOperation = 'destination-over';
|
||||||
paragraphContext.globalAlpha = 0.25;
|
paragraphContext.globalAlpha = 0.25;
|
||||||
paragraphContext.fillStyle = 'black';
|
paragraphContext.fillStyle = savedRollColor;
|
||||||
paragraphContext.fillRect(canvasMargin - textSize * 0.1, savedRollYPosition + canvasMargin - textSize * 0.28, paragraphCanvas.width - 2 * canvasMargin + textSize * 0.2, currentY - savedRollYPosition + textSize * 1.3);
|
paragraphContext.fillRect(canvasMargin - textSize * 0.1, savedRollYPosition + canvasMargin - textSize * 0.28, paragraphCanvas.width - 2 * canvasMargin + textSize * 0.2, currentY - savedRollYPosition + textSize * 1.3);
|
||||||
paragraphContext.globalCompositeOperation = 'source-over';
|
paragraphContext.globalCompositeOperation = 'source-over';
|
||||||
paragraphContext.globalAlpha = 1;
|
paragraphContext.globalAlpha = 1;
|
||||||
|
Reference in New Issue
Block a user