本文整理汇总了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;
}
示例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: 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();
}
示例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();
}