当前位置: 首页>>代码示例>>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;未经允许,请勿转载。