|
54 | 54 | const bone = spineGO.skeleton.findBone("replaceMe"); |
55 | 55 |
|
56 | 56 | const myObject = { |
57 | | - parentScaleX: 1, parentScaleY: 1, parentRotation: 0, |
58 | | - parent2ScaleX: 1, parent2ScaleY: 1, parent2Rotation: 0, |
| 57 | + parentScaleX: 1, parentScaleY: 1, parentRotation: 0, parentShearX: 0, parentShearY: 0, |
| 58 | + parent2ScaleX: 1, parent2ScaleY: 1, parent2Rotation: 0, parent2ShearX: 0, parent2ShearY: 0, |
59 | 59 | scaleX: 1, scaleY: 1, rotation: 0, |
| 60 | + shearX: 0, shearY: 0, |
| 61 | + spriteAlpha: 1, |
60 | 62 | }; |
61 | 63 |
|
62 | 64 | const gui = new lil.GUI({}); |
63 | 65 | gui.add(myObject, 'parentScaleX').min(-3).max(3).step(0.1).name('parentScaleX').onChange(value => parentBone.pose.scaleX = value); |
64 | 66 | gui.add(myObject, 'parentScaleY').min(-3).max(3).step(0.1).name('parentScaleY').onChange(value => parentBone.pose.scaleY = value); |
65 | 67 | gui.add(myObject, 'parentRotation').min(-180).max(180).step(1).name('parentRotation').onChange(value => parentBone.pose.rotation = value); |
| 68 | + gui.add(myObject, 'parentShearX').min(-180).max(180).step(1).name('parentShearX').onChange(value => parentBone.pose.shearX = value); |
| 69 | + gui.add(myObject, 'parentShearY').min(-180).max(180).step(1).name('parentShearY').onChange(value => parentBone.pose.shearY = value); |
66 | 70 | gui.add(myObject, 'parent2ScaleX').min(-3).max(3).step(0.1).name('parent2ScaleX').onChange(value => parent2Bone.pose.scaleX = value); |
67 | 71 | gui.add(myObject, 'parent2ScaleY').min(-3).max(3).step(0.1).name('parent2ScaleY').onChange(value => parent2Bone.pose.scaleY = value); |
68 | 72 | gui.add(myObject, 'parent2Rotation').min(-180).max(180).step(1).name('parent2Rotation').onChange(value => parent2Bone.pose.rotation = value); |
| 73 | + gui.add(myObject, 'parent2ShearX').min(-180).max(180).step(1).name('parent2ShearX').onChange(value => parent2Bone.pose.shearX = value); |
| 74 | + gui.add(myObject, 'parent2ShearY').min(-180).max(180).step(1).name('parent2ShearY').onChange(value => parent2Bone.pose.shearY = value); |
69 | 75 | gui.add(myObject, 'scaleX').min(-3).max(3).step(0.1).name('scaleX').onChange(value => bone.pose.scaleX = value); |
70 | 76 | gui.add(myObject, 'scaleY').min(-3).max(3).step(0.1).name('scaleY').onChange(value => bone.pose.scaleY = value); |
71 | 77 | gui.add(myObject, 'rotation').min(-180).max(180).step(1).name('rotation').onChange(value => bone.pose.rotation = value); |
| 78 | + gui.add(myObject, 'shearX').min(-180).max(180).step(1).name('shearX').onChange(value => bone.pose.shearX = value); |
| 79 | + gui.add(myObject, 'shearY').min(-180).max(180).step(1).name('shearY').onChange(value => bone.pose.shearY = value); |
| 80 | + gui.add(myObject, 'spriteAlpha').min(0).max(1).step(0.01).name('spriteAlpha').onChange(value => sprite.alpha = value); |
72 | 81 |
|
73 | 82 | // add instructions |
74 | 83 | const basicText = new PIXI.Text({ |
75 | | - text: "This example shows that slot objects follow scale and rotation from ancestors too, but if a rotation on a bone occurs scale won't work anymore on ancestors.", |
| 84 | + text: "This example shows that slot objects can follow scale, shear and rotation from ancestors too.", |
76 | 85 | style: { fontSize: 20, fill: "white", wordWrap: true, wordWrapWidth: 300 } |
77 | 86 | }); |
78 | 87 | basicText.position.set(10, 10); |
|
0 commit comments