• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 8 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0022 秒)

1. 鼠标交互-滑动 [ 100%]

... export class Interaction_Swipe { //swipe滚动范围 private TrackLength: number = 200; //触发swipe的拖动距离 private TOGGLE_DIST: number = this.TrackLength / 2; private buttonPosition: number; private beginPosition: number; private endPosition: number; private button: Sprite; constructor() ...

来源: Laya2.0_示例 发布时间: 20241118

2. 缓动-逐字缓动 [ 96%]

...ing = "LayaBox"; for (let i = 0, len = demoString.length; i > 1; var endY: number = Laya.stage.height / 2 - 50; var demoString: string = "LayaBox"; for (var i: number = 0, len: number = demoString.length; i > 1; var endY:int = Laya.stage.height / 2 - 50; var demoString:String = "LayaBox"; for (var i...

来源: Laya2.0_示例 发布时间: 20241118

3. 骨骼动画-Spine事件 [ 92%]

...xport class Skeleton_SpineEvent { private mAniPath:string; private mStartX:number = 400; private mStartY:number = 500; private mFactory:Templet; private mActionIndex:number = 0; private mCurrIndex:number = 0; private mArmature:Skeleton; private mCurrSkinIndex:number = 0; private mFactory2:Templet; p...

来源: Laya2.0_示例 发布时间: 20241118

4. 混合模式-Lighter [ 87%]

...de_Lighter { // 一只凤凰的分辨率是550 * 400 private phoenixWidth: number = 550; private phoenixHeight: number = 400; private bgColorTweener: Tween = new Tween(); private gradientInterval: number = 2000; private bgColorChannels: any = { r: 99, g: 0, b: 0xFF }; constructor() { // 不支持Web...

来源: Laya2.0_示例 发布时间: 20241118

5. 鼠标交互-自定义事件 [ 81%]

...onSpriteClick); } private onSpriteClick(e: Event): void { var randomAngle: number = Math.random() * 180; //发送自定义事件 this.sp.event(Interaction_CustomEvent.ROTATE, [randomAngle]); } // 触发自定义的rotate事件 private onRotate(newAngle: number): void { Tween.to(this.sp, { "rotation"...

来源: Laya2.0_示例 发布时间: 20241118

6. 缓动-缓动函数演示 [ 74%]

...ass Tween_EaseFunctionsDemo { private character: Sprite; private duration: number = 2000; private tween: Tween; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(550, 400, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode =...

来源: Laya2.0_示例 发布时间: 20241118

7. 缓动-简单的Tween [ 69%]

...gColor = "#232628"; this.setup(); } private setup(): void { var terminalX: number = 200; var characterA: Sprite = this.createCharacter("res/cartoonCharacters/1.png"); characterA.pivot(46.5, 50); characterA.y = 100; var characterB: Sprite = this.createCharacter("res/cartoonCharacters/2.png"); charact...

来源: Laya2.0_示例 发布时间: 20241118

8. 鼠标交互-Hold [ 60%]

...L = Laya.WebGL; export class Interaction_Hold { private HOLD_TRIGGER_TIME: number = 1000; private apePath: string = "res/apes/monkey2.png"; //触发hold事件时间为1秒 private ape: Sprite; private isApeHold: Boolean; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.cli...

来源: Laya2.0_示例 发布时间: 20241118