I'm creating a game.
There is a profile. The user has an opportunity to change the place of elements with each other.
When the user does that, the keys of images must be changed between each other too.
And here is the problem: I can't do that at all
Here is the code I'm trying to use:
var loader = new Phaser.Loader(game);
loader.image(draggableElement.key, 'path to lying element', true);
loader.image(lyingElement.key, 'path to dragged element', true);
loader.onLoadComplete.add(doSmthq);
loader.start();
there is an error
Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)'
Thank you in advance! I will really appreciate that =)