-
webkukLikes 0Problem Description
Im doing class
var Cell = cc.Node.extend({
ctor: function(x,y){
this._super();
this.setPosition(x, y);
card = ccs.load(res.cardNode).node;
cardCover = card.getChildByName('card');
cc.eventManager.addListener(cc.EventListener.create({
event: cc.EventListener.MOUSE,
onMouseUp: function (event) {
var target = event.getCurrentTarget();
target.setVisible(false);
}
}), cardCover);
this.addChild(card);
}
});After this add some cells on my scene and when im clicked ALL sprites hided. What im doing wrong?
-
Sonar Systems adminLikes 0
What is target?
-
webkukLikes 0
target is sprite. one from 2 in node
-
Sonar Systems adminLikes 0
How have you created both of the sprites?
-
webkukLikes 0
In Cocos Studio
-
Sonar Systems adminLikes 0
Could you show us a screenshot of Cocos Studio?
-
webkukLikes 0
http://i66.fastpic.ru/big/2015/0304/3a/aa75192f5397cab1583f87f6a709ed3a.jpg
-
Sonar Systems adminLikes 0
How are you retrieving the target Sprite in code?
-
webkukLikes 0
in my first post
card = ccs.load(res.cardNode).node;
cardCover = card.getChildByName('card');
-
webkukLikes 0
u can tell me how add click callback function on sprite ?
-
Sonar Systems adminLikes 0
You generally want to add a callback function on a button not a sprite
like so
-
webkukLikes 0
If Button, how use callback feature from Cocos Studio?
-
Sonar Systems adminLikes 0
Check that link out that I sent you.
-
webkukLikes 0
yes,thx, im read this, but it example for touches, but im need for mouse click
-
webkukLikes 1
sry, my bad, it works fine. Big THX
-
Sonar Systems adminLikes 0
Your very welcome and don’t forget to post any other questions you may have.
Kind regards
Sonar Team
-
webkukLikes 0
hi )) how easy play animation from cocos studio in my code?
-
Sonar Systems adminLikes 0
You can use armature from custom objects which will be covered in our Cocos Studio tutorial series. You can see the status/timeline of our Cocos Studio tutorial series using the link below:
http://www.sonarlearning.co.uk/questions.php?question-topic=40
-
webkukLikes 0
https://drive.google.com/open?id=0B4S6wwcC-ZSUY1M0eVQ2Um5PX3M&authuser=0
Look my example, how play this animation in code?
-
Sonar Systems adminLikes 0
It wouldn’t open for me. What are you trying to achieve?
-
webkukLikes 0
u cant download file or open it? im trying load node with animation(without armature) and play it in my project
-
Sonar Systems adminLikes 0
It won’t open, what sort of animation are you trying to play?
-
webkukLikes 0
https://drive.google.com/open?id=0B4S6wwcC-ZSUZFFCcjQzVlpLVm8&authuser=0
this json file for my node, basic scale animation in timeline
-
Sonar Systems adminLikes 0
Using an action will be easier for this http://cocos.sonarlearning.co.uk/v1.0/docs/actions
-
webkukLikes 0
yes i know it, but i need cocos studio for faster creating animation for many sprites. It is possible? How do action sequence with 2 parallel actions + 2 parallel actions?
-
Sonar Systems adminLikes 0
For simple animations just use actions.
-
webkukLikes 0
what about sequence?
-
Sonar Systems adminLikes 0
Do you want to run them at the same time or one after another once the previous action has completed?
-
webkukLikes 0
i need ScaleTo + RotateTo in paralell for one sprite, after finish this again ScaleTo + RotateTo
-
Sonar Systems adminLikes 0
Just run 2 actions on 2 separate lines and they will run at the same time.
-
webkukLikes 0
I'm confused (( this method for cocos studio? I meant how to do this with actions.
-
Sonar Systems adminLikes 0
Something like this do with code.
-
webkukLikes 0
thx, i did it
-
Sonar Systems adminLikes 0
Great to hear :D
Feel free to post any new questions you have as new questions.
-
webkukLikes 0
Yep, i like teach this biutiful game engine and I dont hesitate to ask any questions
Login to reply