對頁面的元素進(jìn)行一些定位的操作
1 .把A放置在B的左右,上下居中位置
Phaser.Display.Align.In.Center(A,B)
2 .把A放在b的下面居中
Phaser.Display.Align.In.BottomCenter(A,B)
3 .把A對準(zhǔn)一個點(diǎn)
Phaser.Display.Align.In.Center(A, this.add.zone(500, 300))
4 .把A放在B的底部左邊
Phaser.Display.Align.In.BottomRight(block, pic)
也就是8個方向都是可以的
1 .TopLeft,TopCenter,TopRight,RightCenter,BottomRight,BottomCenter,BottomLeft,leftCenter,TopLeft
alpha 透明度疊加也是可以有8個角度的
1 .setAlpha(0.2) 整體上面進(jìn)行0.2 透明度變化
2 .setAlpha(A,B,C,D)
1 .A是左上角的透明度
2 .B是右上角的透明度
3 .C是左下角的透明度
4 .D是右下角的透明度
sea.setAlpha(0, 0, 1, 1);
// 表示一張圖片,左上,左下透明度是0,完全可以看到后面的照片,右上,右下,都是不透過的
過度動畫.這個tween簡直是什么都能運(yùn)動
this.tweens.add({
targets: sea,
alphaTopLeft: { value: 1, duration: 5000, ease: 'Power1' },
alphaBottomRight: { value: 1, duration: 10000, ease: 'Power1' },
alphaBottomLeft: { value: 1, duration: 5000, ease: 'Power1', delay: 5000 },
yoyo: true,
loop: -1
});