當前位置: 首頁>>代碼示例>>Java>>正文


Java Viewport.getWorldWidth方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.utils.viewport.Viewport.getWorldWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java Viewport.getWorldWidth方法的具體用法?Java Viewport.getWorldWidth怎麽用?Java Viewport.getWorldWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.utils.viewport.Viewport的用法示例。


在下文中一共展示了Viewport.getWorldWidth方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public void init(Viewport viewport){
    position = new Vector2();

    // TODO: Set the initial velocity to zero in both directions
    velocity = new Vector2(0, 0);

    radius = viewport.getWorldWidth() * RADIUS_RATIO;
    position.y = viewport.getWorldHeight() + radius;
    Random random = new Random();
    position.x = random.nextFloat() * (viewport.getWorldWidth() - 2 * radius) + radius;
}
 
開發者ID:udacity,項目名稱:ud405,代碼行數:12,代碼來源:Boulder.java

示例2: init

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public void init(Viewport viewport) {
    position = new Vector2(viewport.getWorldWidth() / 2, viewport.getWorldHeight() / 2);
    velocity = new Vector2();
    radiusMultiplier = 1;
    radius = BASE_RADIUS * radiusMultiplier;
    randomKick();
}
 
開發者ID:udacity,項目名稱:ud405,代碼行數:8,代碼來源:BouncingBall.java

示例3: init

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public void init(Viewport viewport){
    position = new Vector2();

    // TODO: Set the initial velocity to zero in both directions
    velocity = new Vector2(0, -200);

    radius = viewport.getWorldWidth() * RADIUS_RATIO;
    position.y = viewport.getWorldHeight() + radius;
    Random random = new Random();
    position.x = random.nextFloat() * (viewport.getWorldWidth() - 2 * radius) + radius;
}
 
開發者ID:udacity,項目名稱:ud405,代碼行數:12,代碼來源:Boulder.java

示例4: init

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public void init(Viewport viewport) {
    position = new Vector2(viewport.getWorldWidth() / 2, viewport.getWorldHeight() / 2);
    velocity = new Vector2();
    radiusMultiplier = 1;
    radius = BASE_RADIUS * radiusMultiplier;
    radiusMultiplier = 1;
}
 
開發者ID:udacity,項目名稱:ud405,代碼行數:8,代碼來源:BouncingBall.java

示例5: init

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public void init(Viewport viewport) {
    this.viewport = viewport;
    position = new Vector2(viewport.getWorldWidth() / 2, viewport.getWorldHeight() / 2);
    velocity = new Vector2();
    baseRadius = RADIUS_FACTOR * Math.min(viewport.getWorldWidth(), viewport.getWorldHeight());
    radiusMultiplier = 1;
}
 
開發者ID:udacity,項目名稱:ud405,代碼行數:8,代碼來源:BouncingBall.java

示例6: init

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public void init(Viewport viewport) {
    position = new Vector2(viewport.getWorldWidth() / 2, viewport.getWorldHeight() / 2);
    velocity = new Vector2();
    radius = RADIUS_FACTOR * Math.min(viewport.getWorldWidth(), viewport.getWorldHeight());
    randomKick();
}
 
開發者ID:udacity,項目名稱:ud405,代碼行數:7,代碼來源:BouncingBall.java

示例7: init

import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public void init(Viewport viewport) {
    position = new Vector2(viewport.getWorldWidth() / 2, viewport.getWorldHeight() / 2);
    velocity = new Vector2();
    randomKick();
}
 
開發者ID:udacity,項目名稱:ud405,代碼行數:6,代碼來源:BouncingBall.java


注:本文中的com.badlogic.gdx.utils.viewport.Viewport.getWorldWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。