大约有 7 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0020 秒)
... new Text(); textBox.addChild(text); text.fontSize = 20; text.text = (Math.random() * 100).toFixed(0); text.rotation = Math.random() * 360; text.color = "#ccc"; text.x = Math.random() * Laya.stage.width; text.y = Math.random() * Laya.stage.height; } //缓存为静态图像 textBox.cacheAs = "bitmap"...
来源: Laya2.0_示例 发布时间: 20251130
...r.life = 0; let pos1; let pos2; if (type % 2) { pos1 = new Point(-20, Math.random() * viewHeight); pos2 = new Point(viewWidth, Math.random() * viewHeight + 20); } else { pos1 = new Point(Math.random() * viewWidth, -20); pos2 = new Point(Math.random() * viewWidth, viewHeight + 20); } let distX = pos1...
来源: Laya2.0_示例 发布时间: 20251130
...food.graphics.drawRect(0, 0, foodSize, foodSize, "#00BFFF"); food.x = Math.random() * Laya.stage.width; food.y = Math.random() * Laya.stage.height; } } class Segment extends Laya.Sprite { constructor(width, height) { super(); this.size(width, height); this.init(); } init() { this.graphics.drawRect(-...
来源: Laya2.0_示例 发布时间: 20251130
...his.sp.on(Event.CLICK, this, this.onSpriteClick); } onSpriteClick(e) { let randomAngle = Math.random() * 180; //发送自定义事件 this.sp.event(ROTATE, [randomAngle]); } // 触发自定义的rotate事件 onRotate(newAngle) { const Tween = Laya.Tween, Ease = Laya.Ease; Tween.to(this.sp, { "rotati...
来源: Laya2.0_示例 发布时间: 20251130
...效。const Browser = Laya.Browser; let starCount = 2500, sx = 1.0 + (Math.random() / 20), sy = 1.0 + (Math.random() / 20), stars = [], w = Browser.width, h = Browser.height, slideX = w / 2, slideY = h / 2, speedInfo; class PIXI_Example_04 { constructor() { const WebGL = Laya.WebGL, Stage = Laya.Sta...
来源: Laya2.0_示例 发布时间: 20251130
...et width = 20, height = 2.5; for (let i = 0; i { let targetX = (300 + Math.random() * 400) / Laya.Physics.PIXEL_RATIO, targetY = 500 / Laya.Physics.PIXEL_RATIO; let newBall = new Laya.Sprite(); Laya.Laya.stage.addChild(newBall); let circleBody = newBall.addComponent(Laya.RigidBody); circleBody.bulle...
来源: Laya2.0_示例 发布时间: 20251130
...).slice(-strLen); } private evalBgColor(): void { var color: number = Math.random() * 0xFFFFFF; var channels: Array = this.getColorChannals(color); this.bgColorTweener.to(this.bgColorChannels, { r: channels[0], g: channels[1], b: channels[2] }, this.gradientInterval, null, Handler.create(this, this....
来源: Laya2.0_示例 发布时间: 20251130