cocos2d-iphone  2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
CCMenuItemSprite Class Reference

#import <CCMenuItem.h>

Inheritance diagram for CCMenuItemSprite:
Collaboration diagram for CCMenuItemSprite:

Instance Methods

(id) - initWithNormalSprite:selectedSprite:disabledSprite:target:selector:
 
(id) - initWithNormalSprite:selectedSprite:disabledSprite:block:
 
(id) - initFromNormalSprite:selectedSprite:disabledSprite:target:selector:
 
(id) - initFromNormalSprite:selectedSprite:disabledSprite:block:
 
 Instance Methods inherited from CCMenuItem
(id) - initWithTarget:selector:
 
(id) - initWithBlock:
 
(CGRect) - rect
 
(void) - activate
 
(void) - selected
 
(void) - unselected
 
(void) - setIsEnabled:
 
(BOOL) - isEnabled
 
(void) - setBlock:
 
(void) - setTarget:selector:
 
(void) - cleanup
 
 Instance Methods inherited from CCNode
(id) - init
 
(void) - onEnter
 
(void) - onEnterTransitionDidFinish
 
(void) - onExit
 
(void) - onExitTransitionDidStart
 
(void) - addChild:
 
(void) - addChild:z:
 
(void) - addChild:z:tag:
 
(void) - removeFromParent
 
(void) - removeFromParentAndCleanup:
 
(void) - removeChild:
 
(void) - removeChild:cleanup:
 
(void) - removeChildByTag:
 
(void) - removeChildByTag:cleanup:
 
(void) - removeAllChildren
 
(void) - removeAllChildrenWithCleanup:
 
(CCNode *) - getChildByTag:
 
(void) - reorderChild:z:
 
(void) - sortAllChildren
 
(void) - draw
 
(void) - visit
 
(void) - transform
 
(void) - transformAncestors
 
(CGRect) - boundingBox
 
(CCAction *) - runAction:
 
(void) - stopAllActions
 
(void) - stopAction:
 
(void) - stopActionByTag:
 
(CCAction *) - getActionByTag:
 
(NSUInteger) - numberOfRunningActions
 
(void) - scheduleUpdate
 
(void) - scheduleUpdateWithPriority:
 
(void) - unscheduleUpdate
 
(void) - schedule:
 
(void) - schedule:interval:
 
(void) - schedule:interval:repeat:delay:
 
(void) - scheduleOnce:delay:
 
(void) - unschedule:
 
(void) - unscheduleAllSelectors
 
(void) - resumeSchedulerAndActions
 
(void) - pauseSchedulerAndActions
 
(void) - update:
 
(CGAffineTransform) - nodeToParentTransform
 
(CGAffineTransform) - parentToNodeTransform
 
(CGAffineTransform) - nodeToWorldTransform
 
(CGAffineTransform) - worldToNodeTransform
 
(CGPoint) - convertToNodeSpace:
 
(CGPoint) - convertToWorldSpace:
 
(CGPoint) - convertToNodeSpaceAR:
 
(CGPoint) - convertToWorldSpaceAR:
 
(CGPoint) - convertTouchToNodeSpace:
 
(CGPoint) - convertTouchToNodeSpaceAR:
 
(void) - setIsRelativeAnchorPoint:
 
(BOOL) - DEPRECATED_ATTRIBUTE
 
(void) - setZOrder:
 
 Instance Methods inherited from <CCRGBAProtocol>
(void) - setColor:
 
(ccColor3B- color
 
(GLubyte) - opacity
 returns the opacity
 
(void) - setOpacity:
 
(void) - setOpacityModifyRGB:
 
(BOOL) - doesOpacityModifyRGB
 

Class Methods

(id) + itemWithNormalSprite:selectedSprite:
 
(id) + itemWithNormalSprite:selectedSprite:target:selector:
 
(id) + itemWithNormalSprite:selectedSprite:disabledSprite:target:selector:
 
(id) + itemWithNormalSprite:selectedSprite:block:
 
(id) + itemWithNormalSprite:selectedSprite:disabledSprite:block:
 
(id) + itemFromNormalSprite:selectedSprite:
 
(id) + itemFromNormalSprite:selectedSprite:target:selector:
 
(id) + itemFromNormalSprite:selectedSprite:disabledSprite:target:selector:
 
(id) + itemFromNormalSprite:selectedSprite:block:
 
(id) + itemFromNormalSprite:selectedSprite:disabledSprite:block:
 
 Class Methods inherited from CCMenuItem
(id) + itemWithTarget:selector:
 
(id) + itemWithBlock:
 
 Class Methods inherited from CCNode
(id) + node
 

Protected Attributes

CCNode< CCRGBAProtocol > * _normalImage
 
CCNode< CCRGBAProtocol > * _selectedImage
 
CCNode< CCRGBAProtocol > * _disabledImage
 
 Protected Attributes inherited from CCMenuItem
void(^ _block )(id sender)
 
BOOL _isEnabled
 
BOOL _isSelected
 
BOOL _releaseBlockAtCleanup
 
 Protected Attributes inherited from CCNode
float rotationX_
 
float rotationY_
 
float scaleX_
 
float scaleY_
 
float vertexZ_
 
CGPoint position_
 
float skewX_
 
float skewY_
 
CGPoint anchorPointInPoints_
 
CGPoint anchorPoint_
 
CGSize contentSize_
 
CGAffineTransform transform_
 
CGAffineTransform inverse_
 
CCCameracamera_
 
CCGridBasegrid_
 
NSInteger zOrder_
 
CCArraychildren_
 
CCNodeparent_
 
NSInteger tag_
 
void * userData_
 
id userObject_
 
CCGLProgramshaderProgram_
 
ccGLServerState glServerState_
 
NSUInteger orderOfArrival_
 
CCSchedulerscheduler_
 
CCActionManageractionManager_
 
BOOL isRunning_
 
BOOL isTransformDirty_
 
BOOL isInverseDirty_
 
BOOL visible_
 
BOOL ignoreAnchorPointForPosition_
 
BOOL isReorderChildDirty_
 

Properties

CCNode< CCRGBAProtocol > * normalImage
 
CCNode< CCRGBAProtocol > * selectedImage
 
CCNode< CCRGBAProtocol > * disabledImage
 
 Properties inherited from CCMenuItem
BOOL isSelected
 
BOOL releaseBlockAtCleanup
 
 Properties inherited from CCNode
NSInteger zOrder
 
float vertexZ
 
float skewX
 
float skewY
 
float rotation
 
float rotationX
 
float rotationY
 
float scale
 
float scaleX
 
float scaleY
 
CGPoint position
 
CCCameracamera
 
CCArraychildren
 
CCGridBasegrid
 
BOOL visible
 
CGPoint anchorPoint
 
CGPoint anchorPointInPoints
 
CGSize contentSize
 
BOOL isRunning
 
CCNodeparent
 
BOOL ignoreAnchorPointForPosition
 
NSInteger tag
 
void * userData
 
id userObject
 
CCGLProgramshaderProgram
 
NSUInteger orderOfArrival
 
ccGLServerState glServerState
 
CCActionManageractionManager
 
CCSchedulerscheduler
 

Detailed Description

CCMenuItemSprite accepts CCNode<CCRGBAProtocol> objects as items. The images has 3 different states:

  • unselected image
  • selected image
  • disabled image
Since
v0.8.0

Method Documentation

- (id) initWithNormalSprite: (CCNode< CCRGBAProtocol > *)  normalSprite
selectedSprite: (CCNode< CCRGBAProtocol > *)  selectedSprite
disabledSprite: (CCNode< CCRGBAProtocol > *)  disabledSprite
block: (id sender)  block 

initializes a menu item with a normal, selected and disabled image with a block. The block will be "copied".

- (id) initWithNormalSprite: (CCNode< CCRGBAProtocol > *)  normalSprite
selectedSprite: (CCNode< CCRGBAProtocol > *)  selectedSprite
disabledSprite: (CCNode< CCRGBAProtocol > *)  disabledSprite
target: (id)  target
selector: (SEL)  selector 

initializes a menu item with a normal, selected and disabled image with target/selector. The "target" won't be retained.

+ (id) itemWithNormalSprite: (CCNode< CCRGBAProtocol > *)  normalSprite
selectedSprite: (CCNode< CCRGBAProtocol > *)  selectedSprite 

creates a menu item with a normal and selected image

+ (id) itemWithNormalSprite: (CCNode< CCRGBAProtocol > *)  normalSprite
selectedSprite: (CCNode< CCRGBAProtocol > *)  selectedSprite
block: (id sender)  block 

creates a menu item with a normal and selected image with a block. The block will be "copied".

+ (id) itemWithNormalSprite: (CCNode< CCRGBAProtocol > *)  normalSprite
selectedSprite: (CCNode< CCRGBAProtocol > *)  selectedSprite
disabledSprite: (CCNode< CCRGBAProtocol > *)  disabledSprite
block: (id sender)  block 

creates a menu item with a normal, selected and disabled image with a block. The block will be "copied".

+ (id) itemWithNormalSprite: (CCNode< CCRGBAProtocol > *)  normalSprite
selectedSprite: (CCNode< CCRGBAProtocol > *)  selectedSprite
disabledSprite: (CCNode< CCRGBAProtocol > *)  disabledSprite
target: (id)  target
selector: (SEL)  selector 

creates a menu item with a normal, selected and disabled image with target/selector. The "target" won't be retained.

+ (id) itemWithNormalSprite: (CCNode< CCRGBAProtocol > *)  normalSprite
selectedSprite: (CCNode< CCRGBAProtocol > *)  selectedSprite
target: (id)  target
selector: (SEL)  selector 

creates a menu item with a normal and selected image with target/selector. The "target" won't be retained.

Property Documentation

- (CCNode<CCRGBAProtocol>*) disabledImage
readwritenonatomicassign

the image used when the item is disabled

- (CCNode<CCRGBAProtocol>*) normalImage
readwritenonatomicassign

the image used when the item is not selected

- (CCNode<CCRGBAProtocol>*) selectedImage
readwritenonatomicassign

the image used when the item is selected


The documentation for this class was generated from the following file: