gpt4 book ai didi

libgdx: scene2d + box2d - 单位

转载 作者:行者123 更新时间:2023-12-02 00:00:29 27 4
gpt4 key购买 nike

我正在开发我的第一个 LibGdx (Scene2d + Box2d) 游戏,这对我来说是一个全新的领域,但仍然对一些事情感到有点困惑,尤其是关于单位。已经看到了几种不同的处理方法,但仍然不确定哪种方法最适合我。

想知道使用舞台视口(viewport)大小是否有任何缺点,例如:16x9(而不是常用的:800x480)以避免转换 box2d => 舞台坐标,为 Box2d 对象和舞台 Actor 使用相同的大小/位置( Sprite 等)?

最佳答案

Wondering if there is any drawback of using stage viewport size eg: 16x9 (rather than commonly used: 800x480) in order to avoid conversions box2d => stage coordinates, use same sizes/positions for Box2d objects as well as for stage actors (sprites etc)?

这正是我所做的。这是一个更好的方法。您不必进行所有这些转换。

可能第一批 libgdx box2d 采纳者没有想到这一点,其他人只是跟着他们:p

关于libgdx: scene2d + box2d - 单位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21700021/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com