本文整理匯總了Java中com.badlogic.gdx.utils.viewport.Viewport.getWorldHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java Viewport.getWorldHeight方法的具體用法?Java Viewport.getWorldHeight怎麽用?Java Viewport.getWorldHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.utils.viewport.Viewport
的用法示例。
在下文中一共展示了Viewport.getWorldHeight方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例6: Menu
import com.badlogic.gdx.utils.viewport.Viewport; //導入方法依賴的package包/類
public Menu(int fontRatio, Color c, String fontPath, Viewport viewport) {
super(viewport);
ftfp = new FreeTypeFontGenerator.FreeTypeFontParameter();
font = new BitmapFont();
ftfp.size = (int)viewport.getWorldHeight() / fontRatio; //the size can be change later
ftfp.color=c;
ftfg = new FreeTypeFontGenerator(Gdx.files.internal(fontPath));
font = ftfg.generateFont(ftfp);
//Skin skinMusique = new Skin();
//skinMusique.add("image", Gdx.files.internal("music64.png"));
//ImageButtonStyle bsMusique = new ImageButton.ImageButtonStyle();
//bsMusique.imageChecked = skinMusique.getDrawable("image");
}
示例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();
radius = RADIUS_FACTOR * Math.min(viewport.getWorldWidth(), viewport.getWorldHeight());
randomKick();
}
示例8: 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();
}