Shubham Seth Posted September 7, 2018 Share Posted September 7, 2018 I get warning in phaser 3 WebGL: INVALID_VALUE: texImage2D: no imageon chrome console while loading the sprite sheet using dataURI (base64) image for first time loading the file and image will not load but after refresh or hard refresh it will auto remove warning and get all the image var image= 'data:image/png , base64, "anyuri" '; var image= 'data:image/png , base64, "base64" '; var cardRandomDistribute = [image1, image2,]; for (var i = 0; i < 10; i++) { var cardsImg = new Image(); var key = "cards" + i; cardsImg.onload = myFunction(i, key, cardsImg); } } function myFunction(i, key, cardsImg) { cardsImg.src = cardRandomDistribute[i]; tempGame.textures.addSpriteSheet(key, cardsImg, { frameWidth: gameOptions.cardSheetWidth, frameHeight: gameOptions.cardSheetHeight }); } Link to comment Share on other sites More sharing options...
Recommended Posts