大约有 12 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0026 秒)
...n(Event.CLICK, this, this.onDecreaseAlpha2); } createButton(label) { const Sprite = Laya.Sprite; let w = 300, h = 60; let button = new Sprite(); Laya.stage.addChild(button); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.size(w, h); button.graphics.fillText(label, w / 2, 17, "20px simHei", ...
来源: Laya2.0_示例 发布时间: 20241118
...is.createLogger(); } createInteractiveTarget() { const Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); rect.size(200, 200); rect.x = (Laya.stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); ...
来源: Laya2.0_示例 发布时间: 20241118
...age.width, Laya.stage.height); } } new SmartScale_T();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Text = Laya.Text; import Event = Laya.Event; import Image = Laya.Image; import WebGL = Laya.WebGL; export class SmartScale_T { //所有适配模式 private modes: Array ...
来源: Laya2.0_示例 发布时间: 20241118
...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_示例 发布时间: 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
...1.png", monkey2Str = "res/apes/monkey2.png", monkey1Res, monkey2Res; class Sprite_SwitchTexture { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.al...
来源: Laya2.0_示例 发布时间: 20241118
...age.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { this.createSprite(); } createSprite() { const Sprite = Laya.Sprite, Event = Laya.Event; this.sp = new Sprite(); this.sp.graphics.drawRect(0, 0, 200, 200, "#D2691E"); this.sp.pivot(100, 100); this.sp.x = Laya.stage.width / 2; this.sp.y =...
来源: Laya2.0_示例 发布时间: 20241118
...r.width / 2, posy = Laya.Browser.height / 2; let box = this.box = new Laya.Sprite(); box.size(width + height * 2, width + height * 2); box.pivot(box.width / 2, box.height / 2); box.pos(posx, posy); Laya.Laya.stage.addChild(box); let boxBody = box.addComponent(Laya.RigidBody); let box1Shape = box.add...
来源: Laya2.0_示例 发布时间: 20241118
...ayer.getScreenPositionByTilePos(Math.floor(p.x), Math.floor(p.y), p); this.sprite.pos(p.x, p.y); } mapLoaded() { this.layer = this.tiledMap.getLayerByIndex(0); var radiusX = 32; var radiusY = Math.tan(180 / Math.PI * 30) * radiusX; // 14.37 var color = "#FF7F50"; this.sprite = new Laya.Sprite(); thi...
来源: Laya2.0_示例 发布时间: 20241118
...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_示例 发布时间: 20241118