|
|
@@ -61,6 +61,7 @@ export default class Guide extends cc.Component {
|
|
|
this.close();
|
|
|
}
|
|
|
else {
|
|
|
+ this.node_display.getComponent(cc.Mask).type = this.crtGuide.display_type == 0 ? cc.Mask.Type.RECT : cc.Mask.Type.ELLIPSE;
|
|
|
this.node_bg.opacity = 180;
|
|
|
this.node_finger.opacity = 255;
|
|
|
this.node_dialog.opacity = 255;
|
|
|
@@ -116,19 +117,32 @@ export default class Guide extends cc.Component {
|
|
|
|
|
|
//显示区域由大到小动画
|
|
|
if (x != null && y != null && w != null && h != null) {
|
|
|
- //先重置
|
|
|
- this.node_bg.x = this.node_bg.y = this.node_display.x = this.node_display.y = 0;
|
|
|
- this.node_display.width = this.node.width;
|
|
|
- this.node_display.height = this.node.height;
|
|
|
- //动画
|
|
|
- cc.tween(this.node_display)
|
|
|
- .to(0.3, { x: x, y: y, width: w, height: h }, {
|
|
|
- onUpdate: () => {
|
|
|
- this.node_bg.x = -this.node_display.x;
|
|
|
- this.node_bg.y = -this.node_display.y;
|
|
|
- }
|
|
|
- })
|
|
|
- .start();
|
|
|
+ if (this.crtGuide.display_type == 0) {//矩形选中框
|
|
|
+ //先重置
|
|
|
+ this.node_bg.x = this.node_bg.y = this.node_display.x = this.node_display.y = 0;
|
|
|
+ this.node_display.width = this.node.width;
|
|
|
+ this.node_display.height = this.node.height;
|
|
|
+ //动画
|
|
|
+ cc.tween(this.node_display)
|
|
|
+ .to(0.3, { x: x, y: y, width: w, height: h }, {
|
|
|
+ onUpdate: () => {
|
|
|
+ this.node_bg.x = -this.node_display.x;
|
|
|
+ this.node_bg.y = -this.node_display.y;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .start();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ //先重置
|
|
|
+ this.node_bg.x = this.node_display.x = x;
|
|
|
+ this.node_bg.y = this.node_display.y = y;
|
|
|
+ this.node_display.width = this.node_display.height = this.node_bg.width = this.node_bg.height = this.node.height * 2;
|
|
|
+ //动画
|
|
|
+ let radius = this.crtGuide.display_type;
|
|
|
+ cc.tween(this.node_display)
|
|
|
+ .to(0.3, { width: radius, height: radius })
|
|
|
+ .start();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//对话框位置
|
|
|
@@ -195,6 +209,8 @@ export default class Guide extends cc.Component {
|
|
|
private reset() {
|
|
|
this.node_display.width = 0;
|
|
|
this.node_display.height = 0;
|
|
|
+ this.node_bg.width = this.node.width;
|
|
|
+ this.node_bg.height = this.node.height;
|
|
|
this.node_bg.x = -this.node_display.x;
|
|
|
this.node_bg.y = -this.node_display.y;
|
|
|
this.node_bg.opacity = 0;
|