egret 使用的一些小技巧

来源:互联网 发布:如何找淘宝达人推广 编辑:程序博客网 时间:2024/05/20 12:25

//判断是否是移动设备

1.egret.Browser.getInstance().isMobile;

//舞台宽度

2.egret.MainContext.instance.stage.stageWidth


3.竖屏 meta name="screen-orientation" content="portrait"
4.横屏 meta name="screen-orientation" content="landscape"

5.stage.stageWidth 屏幕分辨率

6.
this.relativeAnchorPointX = 0.5;//定位中心点
this.relativeAnchorPointY = 0.5;

7.打开网页 window.open (url,"_blank")


0 0
原创粉丝点击