问题
I need function like this, but for Phaser.
wade.addSceneObject(new SceneObject(dotSprite, 0, dotPosition.x, dotPosition.y));
回答1:
Based upon how I understand your question, I'd highly recommend looking at a Phaser tutorial before you go too much further. The official tutorials are really quite good.
Based upon the documentation for WADE I see that addSceneObject adds an object and SceneObject creates one. So, you want to know how to add a sprite to a game.
In Phaser this would be something like:
game.add.sprite(dotPosition.x, dotPosition.y, 'spriteKey');
The Add a Sprite demo shows how to load the image into the cache so it can be included on the page.
来源:https://stackoverflow.com/questions/43565163/function-for-adding-object-in-phaser