开发者

Multiplayer AndEngine Error

开发者 https://www.devze.com 2023-02-09 23:38 出处:网络
I hope someone has experienced this error before and let me know what I need to do. I have one error from using the multiplayerexample.java. This error is in addEntity and the error shown is The met

I hope someone has experienced this error before and let me know what I need to do.

I have one error from using the multiplayerexample.java. This error is in addEntity and the error shown is The method addEntity(Sprite) is undefined for the type Layer.

This is in the following method:

  public void addFace(final Scene pScene, final float pX, final float pY) {
        /* Create the face and a开发者_Python百科dd it to the scene. */
        final Sprite face = new Sprite(pX, pY, this.mFaceTextureRegion);
        pScene.getTopLayer().addEntity(face);
}

Also the getTopLayer() method shows as - The method getTopLayer() from the type Scene is deprecated

Any help on this will be appreciated. Thanks


Found the answer here:

http://www.andengine.org/forums/development/gettoplayer-deprecated-t1826.html

Need to replace it with: pScene.attachChild(face);

0

精彩评论

暂无评论...
验证码 换一张
取 消