悉野小楼

导航

2025年10月27日

laya spine事件

摘要: // 加载完成事件 this.spine.on(Laya.Event.READY, this, ()=>{ let skinName: string = "test"; // 更换已存在的皮肤 this.spine.showSkinByName(skinName); }); // spine触发事件 阅读全文

posted @ 2025-10-27 11:05 悉野 阅读(0) 评论(0) 推荐(0)

2025年10月11日

laya自定义滚动条

摘要: 滚动条不是纯色, 不好缩放, 可以使用蒙版自己移动图片 testBar是滚动条, 使用jdt.png, jdt$bar是个透明图片. bar2蓝色的图, 使用barMask做蒙版 const { regClass, property } = Laya; @regClass() export clas 阅读全文

posted @ 2025-10-11 20:41 悉野 阅读(7) 评论(0) 推荐(0)

2025年10月8日

laya 武器旋转砍怪判断

摘要: typescript代码: export interface IMonster extends Laya.Node { id: number; isDie:boolean; getPoint(): Laya.Point; getHitRect():Laya.Rectangle; } export c 阅读全文

posted @ 2025-10-08 16:57 悉野 阅读(10) 评论(0) 推荐(0)

2025年9月30日

laya列表连续请求例子

摘要: laya列表连续请求例子, 分页请求数据, 使用的是Laya 3.0.10版本 export class TestPanel extends TestPanelBase { private _packetData: any = []; // 列表数据 private _pageSize: numbe 阅读全文

posted @ 2025-09-30 14:17 悉野 阅读(3) 评论(0) 推荐(0)

2025年9月2日

typescript单例 例子

摘要: //例子1:GameManager.ts export default class GameManager { private static _instance: GameManager; public static get instance(): GameManager { if (!this._ 阅读全文

posted @ 2025-09-02 17:58 悉野 阅读(6) 评论(0) 推荐(0)

2025年8月25日

for..of 与 for..in 语句

摘要: 参考: for ...in 遍历key, for...of遍历值 for..of 和 for..in 语句都遍历列表;但是,迭代的值不同,for..in 返回被迭代对象的键列表,而 for..of 返回被迭代对象的数字属性的值列表。 Both for..of and for..in statemen 阅读全文

posted @ 2025-08-25 11:23 悉野 阅读(3) 评论(0) 推荐(0)

2025年8月21日

laya vscode调试typescript

摘要: laya vscode调试typescript launch.json配置 { "version": "0.2.0", "configurations": [ { "type": "chrome", "request": "launch", "name": "针对 localhost 启动 Chro 阅读全文

posted @ 2025-08-21 13:35 悉野 阅读(10) 评论(0) 推荐(0)

2025年8月11日

在android studio可以打包apk的情况下, 使用命令行打包apk

摘要: 在android studio可以打包apk的情况下 需要设置项目根目录的gradle.properties增加org.gradle.java.home=D:/Program Files/Android/Android Studio2022/jre执行 ./gradlew clean assembl 阅读全文

posted @ 2025-08-11 19:55 悉野 阅读(28) 评论(0) 推荐(0)

2025年8月6日

手机号脱敏

摘要: 手机号脱敏 function maskPhoneNumber(phone: string): string { return phone.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2'); } //arr.splice(3, 4, '****')​​:从数组的 阅读全文

posted @ 2025-08-06 15:31 悉野 阅读(16) 评论(0) 推荐(0)

2025年8月1日

laya spine手动调整位置

摘要: declare interface FruitData { id: number; name: string; scale: number; y: number; } private fruitTransform: any = { 3007:{"id": 3007, "name": "菠萝蜜", " 阅读全文

posted @ 2025-08-01 14:25 悉野 阅读(5) 评论(0) 推荐(0)