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

#import <CCMenuItem.h>

+ Inheritance diagram for CCMenuItemSprite:
+ Collaboration diagram for CCMenuItemSprite:

List of all members.

Public Member Functions

(id) - initWithNormalSprite:selectedSprite:disabledSprite:target:selector:
(id) - initWithNormalSprite:selectedSprite:disabledSprite:block:
(id) - initFromNormalSprite:selectedSprite:disabledSprite:target:selector:
(id) - initFromNormalSprite:selectedSprite:disabledSprite:block:

Static Public Member Functions

(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:

Protected Attributes

CCNode< CCRGBAProtocol > * _normalImage
CCNode< CCRGBAProtocol > * _selectedImage
CCNode< CCRGBAProtocol > * _disabledImage

Properties

CCNode< CCRGBAProtocol > * normalImage
CCNode< CCRGBAProtocol > * selectedImage
CCNode< CCRGBAProtocol > * disabledImage

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

Member Function 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 [read, write, assign]

the image used when the item is disabled

- (CCNode<CCRGBAProtocol>*) normalImage [read, write, assign]

the image used when the item is not selected

- (CCNode<CCRGBAProtocol>*) selectedImage [read, write, assign]

the image used when the item is selected


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