public override void cleanup() { if (_releaseBlockAtCleanup) { _block = null; } base.cleanup(); }
protected virtual void initWithBlock(CCMenuItemDelegate block){ if(block!=null) _block = block; this.anchorPoint = new Vector2 (0.5f, 0.5f); _isEnabled = true; _isSelected = false; // WARNING: Will be disabled in v2.2 _releaseBlockAtCleanup = true; }
// // Designated initializer // protected void initWithString(string value, CCMenuItemDelegate block) { NSUtils.Assert(value.Length > 0, "Value length must be greater than 0"); _fontName = _globalFontName; _fontSize = _globalFontSize; CCLabelTTF label = new CCLabelTTF(value, _fontName, _fontSize); initWithLabel(label, block); }
// // Designated initializer // public void initWithLabel(T label, CCMenuItemDelegate block) { base.initWithBlock(block); _originalScale = 1; _colorBackup = Color.white; this.disabledColor = new Color32(126, 126, 126, 255); this.label = label; this.cascadeColorEnabled = true; this.cascadeOpacityEnabled = true; }
void initWithItems(CCMenuItem[] arrayOfItems, CCMenuItemDelegate block) { base.initWithBlock (block); this.subItems = new List<CCMenuItem>(new List<CCMenuItem>(arrayOfItems)); _currentItem = null; _selectedIndex = int.MaxValue; this.selectedIndex = 0; this.cascadeColorEnabled = true; this.cascadeOpacityEnabled = true; }
void initWithItems(CCMenuItem[] arrayOfItems, CCMenuItemDelegate block) { base.initWithBlock(block); this.subItems = new List <CCMenuItem>(new List <CCMenuItem>(arrayOfItems)); _currentItem = null; _selectedIndex = int.MaxValue; this.selectedIndex = 0; this.cascadeColorEnabled = true; this.cascadeOpacityEnabled = true; }
protected virtual void initWithBlock(CCMenuItemDelegate block) { if (block != null) { _block = block; } this.anchorPoint = new Vector2(0.5f, 0.5f); _isEnabled = true; _isSelected = false; // WARNING: Will be disabled in v2.2 _releaseBlockAtCleanup = true; }
void init(string normalImage, string selectedImage, string disabledImage, CCMenuItemDelegate block) { CCSprite normalSprite = new CCSprite(normalImage); CCSprite selectedSprite = null; CCSprite disabledSprite = null; if (selectedImage != null) { selectedSprite = new CCSprite(selectedImage); } if (disabledImage != null) { disabledSprite = new CCSprite(disabledImage); } base.init(normalSprite, selectedSprite, disabledSprite, block); }
public CCMenuItemSprite(T normalSprite, T selectedSprite, T disabledSprite = null, CCMenuItemDelegate block = null) { init(normalSprite, selectedSprite, disabledSprite, block); }
public CCMenuItemToggle(CCMenuItemDelegate block, params CCMenuItem[] items){ initWithItems (items, block); }
public CCMenuItemToggle(CCMenuItemDelegate block, params CCMenuItem[] items) { initWithItems(items, block); }
/** Sets the block that is called when the item is tapped. * The block will be "copied". */ public void setBlock(CCMenuItemDelegate block) { _block = block; }
public CCMenuItem(CCMenuItemDelegate selector) { initWithBlock(selector); }
/** Sets the block that is called when the item is tapped. The block will be "copied". */ public void setBlock(CCMenuItemDelegate block){ _block = block; }
public override void cleanup () { if( _releaseBlockAtCleanup ) { _block = null; } base.cleanup (); }
public CCMenuItemLabel(T label, CCMenuItemDelegate block = null) { initWithLabel(label, block); }
public CCMenuItemImage(string normalImage, string selectedImage, CCMenuItemDelegate block) { init(normalImage, selectedImage, null, block); }
public CCMenuItemImage(string normalImage, string selectedImage, string disabledImage = null, CCMenuItemDelegate block = null) { init(normalImage, selectedImage, disabledImage, block); }
/** creates a menu item from a string with the specified block. * The block will be "copied". */ public CCMenuItemFont(string value, CCMenuItemDelegate block) { initWithString(value, block); }
protected virtual void init(T normalSprite, T selectedSprite, T disabledSprite = null, CCMenuItemDelegate block = null) { base.initWithBlock(block); this.normalImage = normalSprite; this.selectedImage = selectedSprite; this.disabledImage = disabledSprite; this.contentSize = _normalImage.contentSize; this.cascadeColorEnabled = true; this.cascadeOpacityEnabled = true; }
public CCMenuItem(CCMenuItemDelegate selector){ initWithBlock (selector); }