我有一个我在这里制作的通用池:
public class FruitPool extends GenericPool<Sprite> {
// ===========================================================
// Constants
// ===========================================================
// ===========================================================
// Fields
// ===========================================================
private final TextureRegion mTextureRegion;
private Scene mScene;
// ===========================================================
// Constructors
// ===========================================================
public FruitPool(final TextureRegion pFruitTextureRegion, Scene mScene2) {
this.mTextureRegion = pFruitTextureRegion;
this.mScene = mScene2;
}
// ===========================================================
// Getter & Setter
// ===========================================================
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
protected Sprite onAllocatePoolItem() {
Random rand = new Random();
//I want to get the Screens Display metrics …Run Code Online (Sandbox Code Playgroud) 有人能举例说明如何获得当前显示屏幕的中心坐标吗?我希望我的对象始终相对于活动视图的中心坐标.