当前位置: 首页>>代码示例>>Java>>正文


Java Viewport.getWorldHeight方法代码示例

本文整理汇总了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;
}
 
开发者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: 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");
}
 
开发者ID:naomiHauret,项目名称:OdysseeDesMaths,代码行数:14,代码来源:Menu.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();
    radius = RADIUS_FACTOR * Math.min(viewport.getWorldWidth(), viewport.getWorldHeight());
    randomKick();
}
 
开发者ID:udacity,项目名称:ud405,代码行数:7,代码来源:BouncingBall.java

示例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();
}
 
开发者ID:udacity,项目名称:ud405,代码行数:6,代码来源:BouncingBall.java


注:本文中的com.badlogic.gdx.utils.viewport.Viewport.getWorldHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。