ccmenuitem

How to stop all CCTouch under a modal layer in cocos2d?

非 Y 不嫁゛ 提交于 2019-12-10 16:39:04
问题 In my cocos2d game I have a "Settings" button which launches a modal layer and is meant to lock everything under it. To do this, I use a combination of a menu status method which locks all CCMenuItems and I use a coverlayer; both of which are below in code. The problem is that neither solution seems to work on CCScrollLayers. When I click the button (which launches the modal) the CCScrollLayer can still be scrolled which is not what i want. I'd like to: Press a button disabled ALL touches and

CCMenu responds to touches when touched elsewhere

旧巷老猫 提交于 2019-12-08 07:56:49
问题 This is the code I'm using to display the menu. CCMenu *topMenu = [CCMenu menuWithItems:menuItem1, menuItem2, menuItem3, menuItem4, menuItem5, menuItem6, menuItem7, menuItem8, nil]; [topMenu alignItemsHorizontallyWithPadding:0.0f]; topMenu.position = ccp(winSize.width/2, 725); [self addChild:topMenu]; I'm sure that this menu gets added only once. But for some strange reasons, touching on the area shown in the attached photo activates my menu. (You can see the "Home" menu item selected when my

Creating an Options Menu in Android

烈酒焚心 提交于 2019-12-07 03:10:30
问题 I'm trying to make an option menu in android like this link http://developer.android.com/guide/topics/ui/menus.html#options-menu but my developed menu shows not on bottom of my page but in top action bar. my xml is bellow my_options_menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/new_game" android:icon="@drawable/menu_addnew" android:title="Νέο" android:showAsAction="ifRoom"/> <item android:id="@+id/help" android:icon="@drawable/menu_addnew"

CCMenu responds to touches when touched elsewhere

大憨熊 提交于 2019-12-06 15:28:42
This is the code I'm using to display the menu. CCMenu *topMenu = [CCMenu menuWithItems:menuItem1, menuItem2, menuItem3, menuItem4, menuItem5, menuItem6, menuItem7, menuItem8, nil]; [topMenu alignItemsHorizontallyWithPadding:0.0f]; topMenu.position = ccp(winSize.width/2, 725); [self addChild:topMenu]; I'm sure that this menu gets added only once. But for some strange reasons, touching on the area shown in the attached photo activates my menu. (You can see the "Home" menu item selected when my finger is totally somewhere else. Touching on areas slightly to the right makes the "Level" menu