Egret:重力感应
来源:互联网 发布:java集合类特点 编辑:程序博客网 时间:2024/05/17 08:47
class MotionExample extends egret.DisplayObjectContainer { label: egret.TextField; motion: egret.Motion; constructor() { super(); //文本框 this.label = new egret.TextField(); this.label.y = 400; this.label.x = 50; this.addChild(this.label); // 关键代码开始 this.motion = new egret.Motion(); this.motion.addEventListener(egret.Event.CHANGE,this.onMotion,this); this.motion.start(); // 开始监听设备运动状态 // stop ( ):void 停止监听设备运动状态 } onMotion(e:egret.MotionEvent){ this.label.text = "加速度: \n:" + e.accelerationIncludingGravity.x + ",\n:" + e.accelerationIncludingGravity.y + ",\nz:" + e.accelerationIncludingGravity.z;// 关键代码结束 if(e.accelerationIncludingGravity.y > 0) { this.label.y--; } if(e.accelerationIncludingGravity.y < 0) { this.label.y++; } }}转自:http://blog.csdn.net/Miss_Luyou/article/details/53884125?locationNum=4&fps=1
阅读全文
0 0
- egret[重力感应]
- Egret:重力感应
- 重力感应
- 重力感应
- 重力感应
- 重力感应
- 重力感应
- Android重力感应Demo
- Android 重力感应
- android 重力感应
- Android重力感应
- Android重力感应Demo
- android重力感应
- Android 之重力感应
- Android 重力感应
- Android重力感应示例
- Android重力感应
- 手机 重力感应
- 博客园 首页 公告 自定义 时钟 HOME HOME CLOCK,homeclock
- 上转图片并预览
- 论文理解:AlexNet(一)
- codeblocks下muduo环境的配置
- 任务执行顺序
- Egret:重力感应
- Java-JDK-枚举
- 安卓数据库之 Realm for Androd
- 一张思维导图,让正则表达式不再难懂
- Opencv计算两直线交点
- Linux 64bit启动tomcat,64位linux报错Could not initialize class java.awt.image.BufferedImage
- 堆排序之java实现
- spring boot应用启动原理分析
- c和c++调用Python