Commit fb2434ad by doszhang

dos

parent c57edf0a
...@@ -282,7 +282,7 @@ function createHeadimg() { ...@@ -282,7 +282,7 @@ function createHeadimg() {
headimgctx.restore(); headimgctx.restore();
headimgctx.save(); headimgctx.save();
txtDraw(headimgctx, $('[name=customize]').val(), 326, 485, 82, 'normal', '#fff'); txtDraw(headimgctx, $('[name=customize]').val(), 236, 259, 41, 'normal', '#fff');
headimgctx.restore(); headimgctx.restore();
$('#headimg').attr('src',getManBase64(headimgCanvas)); $('#headimg').attr('src',getManBase64(headimgCanvas));
...@@ -393,12 +393,10 @@ function initGame() { ...@@ -393,12 +393,10 @@ function initGame() {
} }
function txtDraw(ctx, content, x, y, fontsize, fontweight, color) { function txtDraw(ctx, content, x, y, fontsize, fontweight, color) {
x = x; x = x * 2;
y = y; y = y * 2;
fontsize = fontsize; fontsize = fontsize * 2;
ctx.font = fontweight + ' '+fontsize+'px zkkh'; ctx.font = fontweight + ' '+fontsize+'px zkkh';
var width = ctx.measureText(content).width;
var cx = x - width / 2;
ctx.fillStyle = color; ctx.fillStyle = color;
......
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