캔버스가 있고 캔버스에 이미지를로드하려고합니다. 캔버스에 vissible하지만 이미지가 drawed되지 않습니다이미지가 발견되었지만 뚜렷하지 않음 Nodejs 및 Express
client.js
game.viewport = document.getElementById('viewport');
game.card1 = document.getElementById('card1');
//Adjust their size
game.viewport.width = game.world.width;
game.viewport.height = game.world.height;
game.card1.width = game.cards.width;
game.card1.height = game.cards.height;
//Fetch the rendering contexts
game.ctx = game.viewport.getContext('2d');
game.ctx2 = game.card1.getContext('2d');
는 텍스트 Summnor2이
game_core.prototype.client_cards = function(game_instance) {
this.instance = game_instance;
var img = new Image();
img.src = '/images/Chainlinks/AddBurn.png';
this.ctx2.drawImage(img,10,20);
this.ctx2.fillStyle = 'rgba(255,255,255,0.7)';
this.ctx2.fillText('Summoner: '+player1, 10 , 20);
을 game_core.js. node.js의 cmd를 보면 그는 이미지 경로를 찾습니다. 그래서 나는 그것이 어디에 잘못되는지 정말로 모른다.
도와주세요.
시도'img.src = './images/Chainlinks/AddBurn.png',' – vinayr
는 그 코드를 반환 문제가 해결되지 않은 : 200 녹색 좋은 이잖아 정도. 하지만 여전히 옳은 것은 아니다. – Julien