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

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

1. 混合模式-Lighter [ 100%]

...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_示例 发布时间: 20241117

2. 骨骼动画-Spine事件 [ 96%]

...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_示例 发布时间: 20241117

3. 鼠标交互-滑动 [ 94%]

... 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_示例 发布时间: 20241117

4. 缓动-逐字缓动 [ 94%]

...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_示例 发布时间: 20241117

5. 缓动-缓动函数演示 [ 84%]

...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_示例 发布时间: 20241117

6. 鼠标交互-自定义事件 [ 83%]

...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_示例 发布时间: 20241117

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

...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_示例 发布时间: 20241117

8. UI-RefreshList [ 68%]

...用于处理单元格上的点击事件等 */ onListMouse(e: Event, index: number): void { console.log(e.target.name); if (e.type == Event.MOUSE_DOWN) { this.mouseDown = true; //如果单元格已经展开,则先恢复 if (this.itemIsOpen) { this.itemIsOpen = false; this.itemOpenId = -1; Tween.to(...

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

9. 鼠标交互-Hold [ 68%]

...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_示例 发布时间: 20241117

10. 缓动-时间线 [ 62%]

...ya.Event; this.timeLine = new TimeLine(); // addLabel(label:String, offset:Number) offset: 标签事件相对于上个动画的偏移时间(单位:毫秒) this.timeLine.addLabel("turnRight", 0).to(this.target, {x:450, y:100, scaleX:0.5, scaleY:0.5}, 2000, null, 0) .addLabel("turnDown", 0).to(this....

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