2 回答

TA贡献1725条经验 获得超7个赞
我认为您的问题是您在“所有图像已加载”回调中绘制图像,但在运行此回调之前绘制了文本。
试试这个:
loadImages(sources, function(images) {
context.drawImage(images.image1, 0, 0, 2220 , 3240);
// context.drawImage image2, 3, ...9,
context.drawImage(images.image10, 170, 2950, 130 ,170);
// Draw text here
context.font = "40pt Calibri";
context.fillText(nome, 20, 20);
context.fillText(potere, 20, 20);
context.fillText(bonus, 20, 20);
});
并在这里替换var为const:
const nome = results.data[i][1];
const potere = results.data[i][6];
const bonus = results.data[i][7];

TA贡献1842条经验 获得超21个赞
我认为您可以在内部甚至画布中使用.append()
和创建文本.contenitoreCarte
用法太简单了,这里文档: https ://api.jquery.com/append/
如果您给我一个 CSV 示例,我可以通过完成您的代码来提交更好的答案
添加回答
举报