大约有 31 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0026 秒)
...nge); } // 方位指示器指向当前所朝方位 createCompass() { const Sprite = Laya.Sprite; compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400);...
来源: Laya2.0_示例 发布时间: 20241117
...ild.x + apeTexture.width; grayApe.y = secondChild.y; } createApe() { const Sprite = Laya.Sprite; let ape = new Sprite(); Laya.stage.addChild(ape); apeTexture = Laya.loader.getRes(apePath); ape.graphics.drawTexture(apeTexture); return ape; } } new Filters_Color();module laya { import Sprite = Laya.Sp...
来源: Laya2.0_示例 发布时间: 20241117
...er, maskArea, interactionArea, hitArea, tipContainer, guideStep = 0; class Sprite_Guide { constructor() { const WebGL = Laya.WebGL, Stage = Laya.Stage; // 不支持WebGL时自动切换至Canvas Laya.init(1285, 727, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTE...
来源: Laya2.0_示例 发布时间: 20241117
...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_示例 发布时间: 20241117
...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Sprite = Laya.Sprite, Tween = Laya.Tween; let terminalX = 200; let characterA = this.createCharacter("res/cartoonCharacters/1.png"); characterA.pivot(46.5, 50); characterA.y = 100; let characterB = this.createCharacter("res/c...
来源: Laya2.0_示例 发布时间: 20241117
...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_示例 发布时间: 20241117
...setup(); } setup() { const Event = Laya.Event; var gap = 10; //创建一个Sprite充当音效播放按钮 let soundButton = this.createButton("播放音效"); soundButton.x = (Laya.stage.width - soundButton.width * 2 + gap) / 2; soundButton.y = (Laya.stage.height - soundButton.height) / 2; //创建...
来源: Laya2.0_示例 发布时间: 20241117
....x = -extraSpace; } } } new PerformanceTest_Cartoon();module laya { import Sprite = Laya.Sprite; import Loader = Laya.Loader; import Browser = Laya.Browser; import Handler = Laya.Handler; import Stat = Laya.Stat; import WebGL = Laya.WebGL; export class PerformanceTest_Cartoon { private colAmount = 1...
来源: Laya2.0_示例 发布时间: 20241117
... y); } tick += 0.1; } } new PerformanceTest_Maggots();module laya { import Sprite = Laya.Sprite; import Browser = Laya.Browser; import Handler = Laya.Handler; import Stat = Laya.Stat; import Rectangle = Laya.Rectangle; import WebGL = Laya.WebGL; export class PerformanceTest_Maggots { private texture...
来源: Laya2.0_示例 发布时间: 20241117
...; Laya.stage.on(Event.KEY_DOWN, this, this.keyDown); } createApe() { const Sprite = Laya.Sprite; this.target = new Sprite(); Laya.stage.addChild(this.target); this.target.loadImage("res/apes/monkey2.png"); this.target.pivot(55, 72); this.target.pos(100,100); } createTimerLine() { const TimeLine = La...
来源: Laya2.0_示例 发布时间: 20241117