Narendrabrsoft / cocos2d-android-1

Automatically exported from code.google.com/p/cocos2d-android-1
0 stars 0 forks source link

can CCMenuItemImage be scaled? #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  CCMenu with 3 scaled CCMenuItemImage 
2.  the item won't response for the touch event

Please provide any additional information below.
occurs on magic and n1

Original issue reported on code.google.com by NGl...@gmail.com on 17 Oct 2010 at 8:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
a game layer with code below at initial time:

//===============================
CCMenuItemImage tool1 = CCMenuItemImage.item("power.png", "power1.png", this, 
"powerCall");
CCMenuItemImage tool2 = CCMenuItemImage.item("freeze.png", "freeze1.png", this, 
"freezeCall");
tool1.setScale(2); // power.png freeze.png is small, so i get larger
tool2.setScale(2);
CCMenu menu = CCMenu.menu(tool1,tool2);
menu.alignItemsVertically();
this.addChild(menu);

//========================
all the png is the assets folder and  menuItem works fine without scaling; 
after scaled, the menuItem won't respond for the touch event.

Original comment by NGl...@gmail.com on 19 Oct 2010 at 5:00

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
find out... 
menu.setPosition(CGPoint.ccp(0,0)); 
without this line,  scaled menuItemImage can't repsond to touch event. 
thanks Weikuan  :)

Original comment by NGl...@gmail.com on 22 Oct 2010 at 4:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I see, someday ago  i debug and followed here,
but with most linear algebra knowledge forgotten ,
 i can't find the where the problem is T.T.... 

ps, you can check the SceneTest in  given Cocos2d Demo,
just press down a label and don't get up, in my htc magic, 
the label just become bigger and then smaller continuously. 
when touch ended , sometimes the label can't return normal size,
and never respond to the touch event. 
I think this is also releated to the affine problem mentioned above :)

Original comment by NGl...@gmail.com on 23 Oct 2010 at 4:21

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
would you please post the Modifition part in CCNode.java?
find cocos2d is new to me and very worried about changing the code wrongly.
where should i  update if i want my CCMenuItemLabel work correctly (fix long 
touch problem)?  thanks for your patience and the great work : )

Original comment by NGl...@gmail.com on 23 Oct 2010 at 3:40