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

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

1. 输入设备-贪吃蛇(重力感应) [ 100%]

... return new Point(tx, ty); } this.size(width, height); this.init(); } Laya.class(Segment, "Segment", Sprite); var seg; var segments = []; var foods = []; var initialSegmentsAmount = 5; var vx = 0, vy = 0; var targetPosition; (function() { Laya.init(Browser.width, Browser.height, WebGL); // 初始化...

来源: Laya_示例 发布时间: 20241002

2. Sprite-缓存为静态图像 [ 99%]

...xt = Laya.Text; import Stat = Laya.Stat; import WebGL = Laya.WebGL; export class Sprite_Cache { constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya...

来源: Laya_示例 发布时间: 20241002

3. Sprite-容器 [ 95%]

...ya.Event; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Sprite_Container { // 该容器用于装载4张猩猩图片 private apesCtn: Sprite; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alig...

来源: Laya_示例 发布时间: 20241002

4. 区块地图-等角地图 [ 95%]

...ectangle; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class TiledMap_IsometricWorld { private tiledMap: TiledMap; private layer: MapLayer; private sprite: Sprite; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(1600, 800, WebGL); Laya.stage.alignV = Stage.ALI...

来源: Laya_示例 发布时间: 20241002

5. 高级应用-闪光 [ 93%]

...Math.sin(scaleValue * 20) * 2; glitter.addGlitterByPositions(pos1, pos2); }class GlitterDemo { private glitter: Laya.Glitter; private pos1: Laya.Vector3; private pos2: Laya.Vector3; private scaleDelta: number = 0; private scaleValue: number = 0; constructor() { Laya3D.init(0, 0, true); Laya.stage.sc...

来源: Laya_示例 发布时间: 20241002

6. 其他引擎的Demo-Example_23 [ 91%]

...} } } // increment the ticker tick += 1; } } } import laya.display.Sprite; class Laser extends Sprite { public var life:int; }

来源: Laya_示例 发布时间: 20241002

7. 混合模式-Lighter [ 90%]

...Laya.Handler; import Tween = Laya.Tween; import WebGL = Laya.WebGL; export class BlendMode_Lighter { // 一只凤凰的分辨率是550 * 400 private phoenixWidth: number = 550; private phoenixHeight: number = 400; private bgColorTweener: Tween = new Tween(); private gradientInterval: number = 2000; ...

来源: Laya_示例 发布时间: 20241002

8. 鼠标交互-双指旋转(多点触控) [ 90%]

...ya.Event; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Interaction_Rotate { private sp: Sprite; private preRadian: number = 0; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.AL...

来源: Laya_示例 发布时间: 20241002

9. Sprite3D-Sprite3D变换 [ 86%]

...cale.z = Math.abs(scaleValue); layaMonkey3.transform.localScale = _scale; }class Sprite3DTransform { private layaMonkey1: Laya.Sprite3D; private layaMonkey2: Laya.Sprite3D; private layaMonkey3: Laya.Sprite3D; private _position: Laya.Vector3; private _rotate: Laya.Vector3; private _scale: Laya.Vector...

来源: Laya_示例 发布时间: 20241002

10. 射线检测-放置物体 [ 85%]

...ere.transform.rotate(new Laya.Vector3(0, 90, 0), false, false); } }); })();class RayPicking02 { private ray: Laya.Ray = new Laya.Ray(new Laya.Vector3(0, 0, 0), new Laya.Vector3(0, 0, 0)); private point: Laya.Vector2 = new Laya.Vector2(); private _outHitInfo: Laya.RaycastHit = new Laya.RaycastHit(); ...

来源: Laya_示例 发布时间: 20241002