问题描述
我是新来AndEngine。我已经看到了很多地方,但不能使用PIXEL_TO_METER_RATIO来了解何时以及如何使用该常量。任何人都可以引导正确的方向?
I am new to AndEngine. I have seen use of PIXEL_TO_METER_RATIO in lot of places but not able to understand when and how this constant is used. Can anyone guide to the right direction?
推荐答案
Box2D的,由AndEngine使用的基础物理引擎,使用米作为标准单位。 PIXEL_TO_METER_RATIO描述AndEngine许多像素如何等同于物理引擎一米。例如,如果得到的身体的位置,这将是在米。你会乘它的比例以获得有关场景的位置。
Box2d, the underlying physics engine used by AndEngine, uses meters as standard units. PIXEL_TO_METER_RATIO describes how many pixels in AndEngine are equivalent to one meter in the physics engine. For example, if you get a position of the Body, it will be in meters. You would multiply it by the ratio to get a position on the Scene.
这篇关于AndEngine:PIXEL_TO_METER_RATIO使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!