Skip to Content
Welcome to Vyno! 🍷

.show()

显示角色,可选择性设置初始位置和属性。

函数签名

show(props?: PixiProperty): Figure

基础用法

// 使用默认位置显示 figure.show(); // 指定位置和属性 figure.show({ x: 500, y: 100, scaleX: 0.5, scaleY: 0.5, alpha: 1, });

预设位置

// 定义常用位置 const leftPosition = { x: 100, y: 50, scaleX: 0.4, scaleY: 0.4, }; const rightPosition = { x: 800, y: 50, scaleX: 0.4, scaleY: 0.4, }; // 使用预设位置 anon.show(leftPosition); qing.show(rightPosition);

多角色同时出场

anon.show(leftPosition); Game.parallel(); qing.show(rightPosition);

PixiProperty 属性

属性类型描述
xnumberX 坐标
ynumberY 坐标
scaleXnumberX 缩放
scaleYnumberY 缩放
rotationnumber旋转角度
alphanumber透明度 (0-1)
anchorXnumber锚点 X
anchorYnumber锚点 Y

链式调用

figure.show(position).speak`你好!`;
Last updated on