Commit aae59198 authored by 李维's avatar 李维

dev commit

parent 9713598c
...@@ -563,6 +563,7 @@ export class HotZoneImageItem extends MySprite { ...@@ -563,6 +563,7 @@ export class HotZoneImageItem extends MySprite {
this.image.x = this.image.width/2 this.image.x = this.image.width/2
this.image.y = this.image.height/2 this.image.y = this.image.height/2
this.image.alpha = 0.7; this.image.alpha = 0.7;
this.imageSrc = imageSrc;
this.addChild(this.image,-1); this.addChild(this.image,-1);
callback && callback(this.image) callback && callback(this.image)
}) })
......
...@@ -200,7 +200,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -200,7 +200,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
}); });
}else{ }else{
item.init("assets/default/bg_200_200.png" , 200 , 200, ()=>{ item.init("assets/default/bg_200_200.png" , 200 , 200, ()=>{
item.imageSrc = "" item.imageSrc = "assets/default/bg_200_200.png"
}); });
} }
item.anchorX = 0.5; item.anchorX = 0.5;
...@@ -401,10 +401,34 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -401,10 +401,34 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
} else { } else {
const addX = this.mx - this.oldPos.x;
const addY = this.my - this.oldPos.y; let addX = this.mx - this.oldPos.x;
let addY = this.my - this.oldPos.y;
this.curItem.x += addX; this.curItem.x += addX;
this.curItem.y += addY; this.curItem.y += addY;
// if( !((this.curItem.y + (this.curItem.height)*this.curItem.scaleY)>300) && !(this.curItem.y<0) ){
// if( !((this.curItem.x + (this.curItem.width)*this.curItem.scaleX)>200) && !(this.curItem.x<0) ){
// let addX = this.mx - this.oldPos.x;
// let addY = this.my - this.oldPos.y;
// this.curItem.x += addX;
// this.curItem.y += addY;
// }else{
// if(this.curItem.x<0){
// this.curItem.x = 0;
// }else{
// this.curItem.x = 200-(this.curItem.width)*this.curItem.scaleX;
// }
// }
// }else{
// if(this.curItem.y<0){
// this.curItem.y = 0;
// }else{
// this.curItem.y = 300-(this.curItem.height)*this.curItem.scaleY;
// }
// }
console.log(this.curItem.y + (this.curItem.height)*this.curItem.scaleY)
} }
this.oldPos = {x: this.mx, y: this.my}; this.oldPos = {x: this.mx, y: this.my};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment