This commit is contained in:
pan
2024-08-14 17:47:33 +08:00
parent d28ebf723f
commit 0006a75db9
5 changed files with 1835 additions and 1555 deletions

View File

@@ -78,7 +78,7 @@
"__id__": 1 "__id__": 1
}, },
"_children": [], "_children": [],
"_active": false, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 3 "__id__": 3
@@ -133,8 +133,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 110, "width": 93,
"height": 110 "height": 93
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@@ -170,7 +170,7 @@
"a": 255 "a": 255
}, },
"_spriteFrame": { "_spriteFrame": {
"__uuid__": "27c92e56-a5f9-4a91-a837-468ff584d119@f9941", "__uuid__": "475189e3-a159-45bc-90f5-57864087d290@c7034",
"__expectedType__": "cc.SpriteFrame" "__expectedType__": "cc.SpriteFrame"
}, },
"_type": 0, "_type": 0,
@@ -228,8 +228,8 @@
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 55, "x": 47.5,
"y": 55, "y": 47.5,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@@ -241,8 +241,8 @@
}, },
"_lscale": { "_lscale": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 1, "x": 0.7,
"y": 1, "y": 0.7,
"z": 1 "z": 1
}, },
"_mobility": 0, "_mobility": 0,
@@ -491,8 +491,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 95,
"height": 100 "height": 95
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",

View File

@@ -2557,8 +2557,8 @@
"rawHeight": 16, "rawHeight": 16,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 4,
"borderRight": 0, "borderRight": 5,
"packable": true, "packable": true,
"pixelsToUnit": 100, "pixelsToUnit": 100,
"pivotX": 0.5, "pivotX": 0.5,
@@ -2647,10 +2647,10 @@
"height": 308, "height": 308,
"rawWidth": 231, "rawWidth": 231,
"rawHeight": 308, "rawHeight": 308,
"borderTop": 0, "borderTop": 14,
"borderBottom": 0, "borderBottom": 14,
"borderLeft": 0, "borderLeft": 15,
"borderRight": 0, "borderRight": 13,
"packable": true, "packable": true,
"pixelsToUnit": 100, "pixelsToUnit": 100,
"pivotX": 0.5, "pivotX": 0.5,
@@ -3017,7 +3017,7 @@
"rawHeight": 38, "rawHeight": 38,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 41,
"borderRight": 0, "borderRight": 0,
"packable": true, "packable": true,
"pixelsToUnit": 100, "pixelsToUnit": 100,
@@ -3201,8 +3201,8 @@
"rawHeight": 8, "rawHeight": 8,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 5,
"borderRight": 0, "borderRight": 5,
"packable": true, "packable": true,
"pixelsToUnit": 100, "pixelsToUnit": 100,
"pivotX": 0.5, "pivotX": 0.5,

File diff suppressed because it is too large Load Diff

View File

@@ -50,7 +50,7 @@ export class CardControllerComp extends CCComp {
let card = ecs.getEntity<HeroCard>(HeroCard); let card = ecs.getEntity<HeroCard>(HeroCard);
let pos = v3(x,y) let pos = v3(x,y)
card.load(pos,element[0],cards_node); card.load(pos,element[0],cards_node);
x=x+120 x=x+100
}); });
this.node.getChildByName("cards").getChildByName("active").active = false this.node.getChildByName("cards").getChildByName("active").active = false
} }

View File

@@ -25,7 +25,7 @@ export class HeroCardViewComp extends CCComp {
pos_x=0; pos_x=0;
pos_y=0; pos_y=0;
protected onLoad(): void { protected onLoad(): void {
this.node.on(NodeEventType.TOUCH_START, this.onTouchMove, this); this.node.on(NodeEventType.TOUCH_START, this.onTouch, this);
this.node.on(NodeEventType.TOUCH_MOVE, this.onTouchMove, this); this.node.on(NodeEventType.TOUCH_MOVE, this.onTouchMove, this);
this.node.on(NodeEventType.TOUCH_END, this.onTouchEnd, this); this.node.on(NodeEventType.TOUCH_END, this.onTouchEnd, this);
this.node.on(NodeEventType.TOUCH_CANCEL, this.onTouchEnd, this); this.node.on(NodeEventType.TOUCH_CANCEL, this.onTouchEnd, this);
@@ -38,13 +38,16 @@ export class HeroCardViewComp extends CCComp {
// this.reset(); // this.reset();
// } // }
} }
onTouch(){
onTouchMove(event: EventTouch) {
smc.vm_data.cards.eid = this.ent.eid; smc.vm_data.cards.eid = this.ent.eid;
let parent = this.node.parent; let parent = this.node.parent;
let active = parent.getChildByName("active"); let active = parent.getChildByName("active");
active.setPosition(this.node.position.x,this.node.position.y) active.setPosition(this.pos_x,this.pos_y)
active.active = true; active.active = true;
active.setPosition(this.node.position.x,this.node.position.y);
}
onTouchMove(event: EventTouch) {
smc.vm_data.cards.eid = this.ent.eid;
// if(this.ent.eid == smc.vm_data.cards.eid){ // if(this.ent.eid == smc.vm_data.cards.eid){
// this.node.getChildByName("active").active = true; // this.node.getChildByName("active").active = true;
// }else{ // }else{