|
@@ -105,6 +105,10 @@ export class game_list extends Component {
|
|
this.start_pos = et.getUILocation()
|
|
this.start_pos = et.getUILocation()
|
|
})
|
|
})
|
|
this.content.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
|
|
this.content.on(Node.EventType.TOUCH_MOVE,(et:EventTouch)=>{
|
|
|
|
+ // console.log('select_page=',gameManager.getStaticUserData().select_page)
|
|
|
|
+ // if(gameManager.getStaticUserData().select_page ==1) {
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
this.onTouchActive = false
|
|
this.onTouchActive = false
|
|
if( Math.abs(this.start_pos.x-et.getUILocation().x)<30){
|
|
if( Math.abs(this.start_pos.x-et.getUILocation().x)<30){
|
|
this.start_pos = et.getUILocation()
|
|
this.start_pos = et.getUILocation()
|
|
@@ -117,7 +121,22 @@ export class game_list extends Component {
|
|
if(this.x_len==0){
|
|
if(this.x_len==0){
|
|
this.x_len = (et.getUILocation().x - pos.x)*1;
|
|
this.x_len = (et.getUILocation().x - pos.x)*1;
|
|
}
|
|
}
|
|
- this.content.position = new Vec3(n_p.x-this.x_len ,this.content.position.y);
|
|
|
|
|
|
+ let content_position_x = n_p.x-this.x_len
|
|
|
|
+ console.log('content_position_x=',content_position_x)
|
|
|
|
+ this.content.position = new Vec3(content_position_x,this.content.position.y);
|
|
|
|
+ // this.onTouchActive = false
|
|
|
|
+ // if( Math.abs(this.start_pos.x-et.getUILocation().x)<30){
|
|
|
|
+ // this.start_pos = et.getUILocation()
|
|
|
|
+ // this.onTouchActive = true
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // let p = new Vec3(et.getUILocation().x,et.getUILocation().y)
|
|
|
|
+ // let n_p = this.content.parent.getComponent(UITransform).convertToNodeSpaceAR(p)
|
|
|
|
+ // let pos = this.content.parent.getComponent(UITransform).convertToWorldSpaceAR(this.content.position)
|
|
|
|
+ // if(this.x_len==0){
|
|
|
|
+ // this.x_len = (et.getUILocation().x - pos.x)*1;
|
|
|
|
+ // }
|
|
|
|
+ // this.content.position = new Vec3(n_p.x-this.x_len ,this.content.position.y);
|
|
})
|
|
})
|
|
this.content.on(Node.EventType.TOUCH_END,()=>{
|
|
this.content.on(Node.EventType.TOUCH_END,()=>{
|
|
this.x_len = 0
|
|
this.x_len = 0
|
|
@@ -134,6 +153,7 @@ export class game_list extends Component {
|
|
touchContentScroll() {
|
|
touchContentScroll() {
|
|
this.onTouchActive = true
|
|
this.onTouchActive = true
|
|
if(this.content.position.x==this.content_original_pos.x) {
|
|
if(this.content.position.x==this.content_original_pos.x) {
|
|
|
|
+ console.log('touchContentScroll touchContentScroll')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if(this.content.position.x < 0) { // 向左滑动
|
|
if(this.content.position.x < 0) { // 向左滑动
|