小编dan*_*941的帖子

LibGDX物理滚动条ScrollPane

我创建了一个ScrollPane,但是没有可以滚动的栏(就像浏览器一侧那样)你必须用鼠标拖动.如何获得滚动条?

libgdx

5
推荐指数
1
解决办法
3192
查看次数

计算宽高比返回0.0

我正在尝试制作一种方法来计算调整大小的宽高比​​.

public float ARC(int oHeight, int oWidth, float nWidth)
{
    float h = (oHeight / oWidth) * (nWidth);
    return h;
}
Run Code Online (Sandbox Code Playgroud)

并运行我正在使用:

System.out.println(ARC(65, 375, 375));
Run Code Online (Sandbox Code Playgroud)

64被指定为oHeight,375被指定为oWidth,375被指定为nWidth.

但是当我测试代码时,输​​出是:0.0?结果应该是65

java aspect-ratio

0
推荐指数
1
解决办法
141
查看次数

标签 统计

aspect-ratio ×1

java ×1

libgdx ×1