悉野小楼

导航

laya spine手动调整位置

declare interface FruitData {
    id: number;
    name: string;
    scale: number;
    y: number;
}

private fruitTransform: any = {
    3007:{"id": 3007, "name": "菠萝蜜", "scale": 1.1, "x": -3, "y": 5},
    3008:{"id": 3008, "name": "牛油果", "scale": 0.38, "x": 10, "y": 20},
    3000:{"id": 3000, "name": "山竹", "scale": 0.4, "x": 3, "y": 0},
    3001:{"id": 3001, "name": "蘑菇", "scale": 0.42, "x": 0, "y": 0},
    3003:{"id": 3003, "name": "南瓜", "scale": 0.5, "x": -5, "y": -10},
};

let tran = this.fruitTransform[data.id];
this.spine.scale(tran.scale, tran.scale);
this.spine.pos(this.spine.x + tran.x, this.spine.y + tran.y) 

 

posted on 2025-08-01 14:25  悉野  阅读(5)  评论(0)    收藏  举报