首页 > 其他 > 详细

9.6、Libgdx之罗盘

时间:2015-02-03 11:02:53      阅读:281      评论:0      收藏:0      [点我收藏+]

(官网:www.libgdx.cn

有些Android和iOS设备可能需要检测使用罗盘检测方向。

注意:罗盘当前在iOS设备中不可用,RoboVM暂不支持。

查询当前罗盘当前是否可用:

boolean compassAvail = Gdx.input.isPeripheralAvailable(Peripheral.Compass);

一旦检测到罗盘可用,可以使用如下代码检测状态:

float azimuth = Gdx.input.getAzimuth();
float pitch = Gdx.input.getPitch();
float roll = Gdx.input.getRoll();

技术分享

www.libgdx.cn版权所有,如需转载,注明出处)

9.6、Libgdx之罗盘

原文:http://blog.csdn.net/song19891121/article/details/43446859

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!