大约有 23 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0030 秒)
...nst stageWidth:int = 800; private const stageHeight:int = 600; private var Matter:Object = Browser.window.Matter; private var LayaRender:Object = Browser.window.LayaRender; private var mouseConstraint:*; private var engine:*; /***/ public function Retitution() { super(); this.width = stageWidth; thi...
来源: Laya_社区 发布时间: 20171214
matter.js 下的 Matter.Render 替换 Matter.Render 换成 window.LayaRender 渲染没有问题 但鼠标约束(MouseConstraint)不起作用 换回Matter.Render就好了 //代码如下 var mouse = Mouse.create(render.canvas), mouseConstraint = MouseConstraint.create(engine, { element:render.can...
来源: Laya_社区 发布时间: 20180803
物理环境如何摧毁 engine = Matter.Engine.create 和 var render = LayaRender.create 再创建物理环境加入了 这两! gameover 中这两个 怎么摧毁? stop 吗?Matter.World. add(刚体 ) 有没统一 remove 的方法! 因为有些临时变量!所以 不易...
来源: Laya_社区 发布时间: 20170421
...Mode = "fixedwidth"; // 宽度不变 this.engine; var world; this.engine = Matter.Engine.create({ enableSleeping: true // 开启睡眠 }); world = this.engine.world; Matter.Engine.run(this.engine); // Engine 启动 var render = LayaRender.create({ engine: this.engine, options: { wireframes: false, b...
来源: Laya_社区 发布时间: 20180522
...00, 32, "#ffff00"); Wall_TL.pivot(200, 16); var Collision_Wall_TL:any = Matter.Bodies.rectangle(200, 400, 400, 32, { layaSprite:Wall_TL,isStatic: true }) Matter.World.add(this.engine.world, [ Collision_Wall_TL, // Collision_Wall_R, // Collision_Wall_TL ]); 如何旋转这个对象 让它倾斜4...
来源: Laya_社区 发布时间: 20180529
Matter和Sprite绑定后图片移位问题 代码: var ball_skin = new Laya.Sprite().loadImage("img/hero.png"); ball_skin.scale(50/120, 80/178); ball_skin.pivot(ball_skin.width / 2, ball_skin.height / 2); var ball = Matter.Bodies.rectangle(330, ...
来源: Laya_社区 发布时间: 20170721
...用Laya.Tween.to来做缓动呢?比如position或者scale TS项目使用matter.js库无智能提示 LayaAirIDE下如何使用mask? 微信小游戏如何使用ttf字体? 使用3D时候,Property 'getComponentByType' does not exist on type 'Node'. 微信小游戏:HTMLDivElement的使用 使...
来源: Laya_社区 发布时间: 20170331
刚体贴图调用问题 在使用matter引擎时,因为需要在刚体上添加多个图片,根据不同情况对各个图片进行各种操作,所以没有使用matter刚体自带的texture属性来设置图片,而是自定义了一个layaSprite来绑定到刚体上,再在layaSprite上...
来源: Laya_社区 发布时间: 20180901
...时候,无法正确获取高度 class RoleUIDynamic extends Laya.Image { matterBody: Matter.Body; constructor() { super(); this.on('start', this, this.init); } private init():void { console.log("init", this.x, this.y, this.width, this.height, this.scaleX, this.scaleY); var createOption: any = { is...
来源: Laya_社区 发布时间: 20180530
matter.js的文档查看 在引擎示例的投石射击中: render: { fillStyle: '#edc51e', strokeStyle: '#b5a91c' } render: { sprite: ...
来源: Laya_社区 发布时间: 20170102