大约有 5 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0020 秒)
...a.stage.removeChild(food); foods.splice(i, 1); } } } produceFood() { const Sprite = Laya.Sprite; // 最多五个食物同屏 if (foods.length == 5) return; let food = new Sprite(); Laya.stage.addChild(food); foods.push(food); const foodSize = 40; food.size(foodSize, foodSize); food.graphics.drawRect...
来源: Laya2.0_示例 发布时间: 20241118
...ine", true); // 设置画布上的对齐参照物 let reference = new Laya.Sprite(); Laya.stage.addChild(reference); reference.pos(100, 100); reference.size(600, 400); reference.graphics.drawRect(0, 0, reference.width, reference.height, "#CCCCCC"); // 每次舞台尺寸变更时,都会调用Utils....
来源: Laya2.0_示例 发布时间: 20241118
...age.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createSprite(); this.drawTrack(); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; const w = 50; const h = 30; this.button = new Sprite(); this.button.graphics.drawRect(0, 0, w, h, "#FF7F50"); this.button.pivot(w ...
来源: Laya2.0_示例 发布时间: 20241118
...teBridge() { const startPosX = 250, startPosY = 450; let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let groundBody = new Laya.RigidBody(); groundBody.type = "static"; ground.addComponentIntance(groundBody); let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider...
来源: Laya2.0_示例 发布时间: 20241118
...s.Construct(); this.eventListener(); } Construct() { let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let rigidbody = new Laya.RigidBody(); rigidbody.type = "static"; ground.addComponentIntance(rigidbody); let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.po...
来源: Laya2.0_示例 发布时间: 20241118