相关疑难解决方法(0)

如何获取活动外的屏幕指标?

我有一个我在这里制作的通用池:

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)

android

19
推荐指数
3
解决办法
2万
查看次数

获取手机屏幕的中心坐标

有人能举例说明如何获得当前显示屏幕的中心坐标吗?我希望我的对象始终相对于活动视图的中心坐标.

java android coordinates

8
推荐指数
1
解决办法
8322
查看次数

标签 统计

android ×2

coordinates ×1

java ×1