Commit 49f99c70 by doszhang

dos

parent b19617f9
...@@ -152,12 +152,13 @@ function createPoster(resultFlag) { ...@@ -152,12 +152,13 @@ function createPoster(resultFlag) {
function drawNum(resultFlag) { function drawNum(resultFlag) {
const text1 = `成为樱桃小丸子的第${window.joinNum}个的`; const text1 = `成为樱桃小丸子的第${window.joinNum}个的`;
const text2 = `祈福伙伴,并获得「${guardian[resultFlag-1]}」` const text2 = `祈福伙伴,并获得「${guardian[resultFlag-1]}」`
txtDraw(posterCtx, text1, 281, 24, 'bolder', '#748b6c'); txtDraw(posterCtx, text1, 320, 281, 24, 'bolder', '#748b6c');
txtDraw(posterCtx, text2, 316, 24, 'bolder', '#748b6c'); txtDraw(posterCtx, text2, 320, 316, 24, 'bolder', '#748b6c');
} }
function txtDraw(ctx, content, top, fontsize, fontweight, color) { function txtDraw(ctx, content, x, y, fontsize, fontweight, color) {
top = top * 2; x = x * 2;
y = y * 2;
fontsize = fontsize * 2; fontsize = fontsize * 2;
ctx.font = fontweight + ' ' + fontsize + 'px arial'; ctx.font = fontweight + ' ' + fontsize + 'px arial';
var width = ctx.measureText(content).width; var width = ctx.measureText(content).width;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment