AndEngine:PIXEL

编程入门 行业动态 更新时间:2024-10-10 17:25:35
本文介绍了AndEngine:PIXEL_TO_METER_RATIO使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是新来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

本文发布于:2023-10-18 15:20:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504614.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:AndEngine   PIXEL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!