PhysicsEditor选择CitrusEngine导出的问题

PhysicsEditor(1.0.10)中选择以Citrus Engine导出的类不能在Citrus Engine中直接使用,可能是PhysicsEditor是根据老版本的Citrus Engine导出的,导出的类结构如下:

import Box2DAS.Collision.Shapes.b2PolygonShape;
import Box2DAS.Common.V2;

import com.citrusengine.objects.PhysicsObject;

/**
* @author Aymeric
* <p>This is a class created by the software http://www.physicseditor.de/</p>
* <p>Just select the CitrusEngine template, upload your png picture, set polygons and export.</p>
* <p>Be careful, the registration point is topLeft !</p>
* @param peObject : the name of the png file
*/
public class PhysicsEditorObjects extends PhysicsObject  {
    ...
}

而Box2DAS.Collision.Shapes.b2PolygonShape、Box2DAS.Common.V2和com.citrusengine.objects.PhysicsObject类在Citrus Engine中并不存在,编译当然出错,其实只需要将Box2DAS.Collision.Shapes.b2PolygonShape替换成Box2D.Collision.Shapes.b2PolygonShape,将Box2DAS.Common.V2替换成Box2D.Common.Math.b2Vec2,将com.citrusengine.objects.PhysicsObject替换成citrus.objects.Box2DPhysicsObject,就可以在Citrus Engine中使用了。

一条评论

  1. carte r4 pour ds说道:

    This is a really good read for me, thank you!

留下评论