本文整理汇总了C#中SelectorProtocol类的典型用法代码示例。如果您正苦于以下问题:C# SelectorProtocol类的具体用法?C# SelectorProtocol怎么用?C# SelectorProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SelectorProtocol类属于命名空间,在下文中一共展示了SelectorProtocol类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: itemFromString
/// <summary>
/// creates a menu item from a string with a target/selector
/// </summary>
public static CCMenuItemFont itemFromString(string value, SelectorProtocol target, SEL_MenuHandler selector)
{
CCMenuItemFont pRet = new CCMenuItemFont();
pRet.initFromString(value, target, selector);
//pRet->autorelease();
return pRet;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:10,代码来源:CCMenuItemFont.cs
示例2: itemFromString
/// <summary>
/// creates a menu item from a string and atlas. Use it with MenuItemToggle
/// </summary>
public static CCMenuItemAtlasFont itemFromString(string value, string charMapFile, int itemWidth, int itemHeight, char startCharMap, SelectorProtocol target, SEL_MenuHandler selector)
{
CCMenuItemAtlasFont pRet = new CCMenuItemAtlasFont();
pRet.initFromString(value, charMapFile, itemWidth, itemHeight, startCharMap, target, selector);
//pRet->autorelease();
return pRet;
}
开发者ID:liwq-net,项目名称:cocos2d-for-xna-windows,代码行数:10,代码来源:CCMenuItemAtlasFont.cs
示例3: itemWithTarget
/// <summary>
/// Creates a CCMenuItem with a target/selector
/// </summary>
/// <param name="rec"></param>
/// <param name="selector"></param>
/// <returns></returns>
public static CCMenuItem itemWithTarget(SelectorProtocol rec, SEL_MenuHandler selector)
{
CCMenuItem pRet = new CCMenuItem();
pRet.initWithTarget(rec, selector);
return pRet;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:13,代码来源:CCMenuItem.cs
示例4: InitFromString
/// <summary>
/// initializes a menu item from a string and atlas with a target/selector
/// </summary>
public bool InitFromString(string value, string charMapFile, int itemWidth, int itemHeight, char startCharMap, SelectorProtocol target,
SEL_MenuHandler selector)
{
// CCAssert( value != NULL && strlen(value) != 0, "value length must be greater than 0");
var label = new CCLabelAtlas(value, charMapFile, itemWidth, itemHeight, startCharMap);
base.InitWithLabel(label, selector);
return true;
}
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:11,代码来源:CCMenuItemAtlasFont.cs
示例5: initWithTarget
/// <summary>
/// Initializes a CCMenuItem with a target/selector
/// </summary>
/// <param name="rec"></param>
/// <param name="selector"></param>
/// <returns></returns>
public bool initWithTarget(SelectorProtocol rec, SEL_MenuHandler selector)
{
anchorPoint = new CCPoint(0.5f, 0.5f);
m_pListener = rec;
m_pfnSelector = selector;
m_bIsEnabled = true;
m_bIsSelected = false;
return true;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:15,代码来源:CCMenuItem.cs
示例6: initWithTarget
// todo
//public static CCCallFuncN actionWithScriptFuncName(string pszFuncName)
//{
// CCCallFuncN pRet = new CCCallFuncN();
// if (pRet && pRet->initWithScriptFuncName(pszFuncName)) {
// pRet->autorelease();
// return pRet;
// }
// CC_SAFE_DELETE(pRet);
// return NULL;
//}
public bool initWithTarget(SelectorProtocol pSelectorTarget, SEL_CallFuncN selector)
{
if (base.initWithTarget(pSelectorTarget))
{
m_pCallFuncN = selector;
return true;
}
return false;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:24,代码来源:CCCallFuncN.cs
示例7: itemFromNormalImage
/// <summary>
/// creates a menu item with a normal and selected image with target/selector
/// </summary>
public static CCMenuItemImage itemFromNormalImage(string normalImage, string selectedImage, string disabledImage, SelectorProtocol target, SEL_MenuHandler selector)
{
CCMenuItemImage pRet = new CCMenuItemImage();
if (pRet.initFromNormalImage(normalImage, selectedImage, disabledImage, target, selector))
{
return pRet;
}
return null;
}
开发者ID:liwq-net,项目名称:cocos2d-for-xna-windows,代码行数:13,代码来源:CCMenuItemImage.cs
示例8: actionWithTarget
public static CCCallFuncO actionWithTarget(SelectorProtocol pSelectorTarget, SEL_CallFuncO selector, CCObject pObject)
{
CCCallFuncO pRet = new CCCallFuncO();
if (pRet != null && pRet.initWithTarget(pSelectorTarget, selector, pObject))
{
return pRet;
}
return null;
}
开发者ID:liwq-net,项目名称:liwq718,代码行数:11,代码来源:CCCallFuncO.cs
示例9: initWithTarget
// todo
//public static CCCallFuncO actionWithScriptFuncName(string pszFuncName)
//{
// CCCallFuncO pRet = new CCCallFuncO();
// if (pRet != null && pRet.initWithScriptFuncName(pszFuncName)) {
// return pRet;
// }
// return null;
//}
public bool initWithTarget(SelectorProtocol pSelectorTarget, SEL_CallFuncO selector, CCObject pObject)
{
if (base.initWithTarget(pSelectorTarget))
{
m_pObject = pObject;
m_pCallFuncO = selector;
return true;
}
return false;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:23,代码来源:CCCallFuncO.cs
示例10: actionWithTarget
public static CCCallFuncN actionWithTarget(SelectorProtocol pSelectorTarget, SEL_CallFuncN selector)
{
CCCallFuncN pRet = new CCCallFuncN();
if (pRet != null && pRet.initWithTarget(pSelectorTarget, selector))
{
return pRet;
}
return null;
}
开发者ID:Openxlive,项目名称:cocos2d-x-for-xna,代码行数:11,代码来源:CCCallFuncN.cs
示例11: initFromString
/// <summary>
/// initializes a menu item from a string and atlas with a target/selector
/// </summary>
public bool initFromString(string value, string charMapFile, int itemWidth, int itemHeight, char startCharMap, SelectorProtocol target, SEL_MenuHandler selector)
{
// CCAssert( value != NULL && strlen(value) != 0, "value length must be greater than 0");
CCLabelAtlas label = new CCLabelAtlas();
label.initWithString(value, charMapFile, itemWidth, itemHeight, startCharMap);
//label->autorelease();
if (base.initWithLabel(label, target, selector))
{
// do something ?
}
return true;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:15,代码来源:CCMenuItemAtlasFont.cs
示例12: actionWithTarget
public static CCCallFunc actionWithTarget(SelectorProtocol pSelectorTarget, SEL_CallFunc selector)
{
CCCallFunc pRet = new CCCallFunc();
if (pRet != null && pRet.initWithTarget(pSelectorTarget))
{
pRet.m_pCallFunc = selector;
return pRet;
}
return null;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:12,代码来源:CCCallFunc.cs
示例13: initWithTarget
// todo
//public static CCCallFuncND actionWithScriptFuncName(string pszFuncName, object d)
//{
// CCCallFuncND pRet = new CCCallFuncND();
// if (pRet != null && pRet.initWithScriptFuncName(pszFuncName))
// {
// pRet.m_pData = d;
// return pRet;
// }
// return null;
//}
public bool initWithTarget(SelectorProtocol pSelectorTarget,
SEL_CallFuncND selector, object d)
{
if (base.initWithTarget(pSelectorTarget))
{
m_pData = d;
m_pCallFuncND = selector;
return true;
}
return false;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:27,代码来源:CCCallFuncND.cs
示例14: actionWithTarget
public static CCCallFuncND actionWithTarget(SelectorProtocol pSelectorTarget,
SEL_CallFuncND selector, object d)
{
CCCallFuncND pRet = new CCCallFuncND();
if (pRet != null && pRet.initWithTarget(pSelectorTarget, selector, d))
{
return pRet;
}
return null;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:12,代码来源:CCCallFuncND.cs
示例15: CCTimer
public CCTimer(CCScheduler scheduler, SelectorProtocol target, SEL_SCHEDULE selector, float seconds, uint repeat, float delay)
{
_scheduler = scheduler;
Target = target;
Selector = selector;
Elapsed = -1;
OriginalInterval = seconds;
Interval = seconds;
m_fDelay = delay;
m_bUseDelay = delay > 0f;
m_nRepeat = repeat;
m_bRunForever = m_nRepeat == uint.MaxValue;
}
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:13,代码来源:CCScheduler.cs
示例16: initFromString
/** initializes a menu item from a string with a target/selector */
public bool initFromString(string value, SelectorProtocol target, SEL_MenuHandler selector)
{
//CCAssert( value != NULL && strlen(value) != 0, "Value length must be greater than 0");
m_strFontName = _fontName;
m_uFontSize = _fontSize;
CCLabelTTF label = CCLabelTTF.labelWithString(value, m_strFontName, (float)m_uFontSize);
if (base.initWithLabel(label, target, selector))
{
// do something ?
}
return true;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:16,代码来源:CCMenuItemFont.cs
示例17: ResumeTarget
public void ResumeTarget(SelectorProtocol target)
{
Debug.Assert(target != null);
// custom selectors
HashSelectorEntry element;
if (m_pHashForSelectors.TryGetValue(target, out element))
{
element.Paused = false;
}
// Update selector
HashUpdateEntry elementUpdate;
if (m_pHashForUpdates.TryGetValue(target, out elementUpdate))
{
elementUpdate.Entry.Paused = false;
}
}
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:18,代码来源:CCScheduler.cs
示例18: initFromNormalSprite
/// <summary>
/// initializes a menu item with a normal, selected and disabled image with target/selector
/// </summary>
public bool initFromNormalSprite(CCNode normalSprite, CCNode selectedSprite, CCNode disabledSprite,
SelectorProtocol target, SEL_MenuHandler selector)
{
if (normalSprite == null)
{
throw new ArgumentNullException("normalSprite");
}
initWithTarget(target, selector);
NormalImage = normalSprite;
SelectedImage = selectedSprite;
DisabledImage = disabledSprite;
contentSize = m_pNormalImage.contentSize;
return true;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:21,代码来源:CCMenuItemSprite.cs
示例19: itemFromNormalSprite
/// <summary>
/// creates a menu item with a normal,selected and disabled image with target/selector
/// </summary>
/// <param name="normalSprite"></param>
/// <param name="selectedSprite"></param>
/// <param name="disabledSprite"></param>
/// <param name="target"></param>
/// <param name="selector"></param>
/// <returns></returns>
public static CCMenuItemSprite itemFromNormalSprite(CCNode normalSprite, CCNode selectedSprite, CCNode disabledSprite,
SelectorProtocol target, SEL_MenuHandler selector)
{
CCMenuItemSprite pRet = new CCMenuItemSprite();
pRet.initFromNormalSprite(normalSprite, selectedSprite, disabledSprite, target, selector);
//pRet->autorelease();
return pRet;
}
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:17,代码来源:CCMenuItemSprite.cs
示例20: PriorityIn
private void PriorityIn(LinkedList<ListEntry> list, SelectorProtocol target, int priority, bool paused)
{
var listElement = new ListEntry
{
Target = target,
Priority = priority,
Paused = paused,
MarkedForDeletion = false
};
if (list.First == null)
{
list.AddFirst(listElement);
}
else
{
bool added = false;
for (LinkedListNode<ListEntry> node = list.First; node != null; node = node.Next)
{
if (priority < node.Value.Priority)
{
list.AddBefore(node, listElement);
added = true;
break;
}
}
if (!added)
{
list.AddLast(listElement);
}
}
// update hash entry for quick access
var hashElement = new HashUpdateEntry
{
Target = target,
List = list,
Entry = listElement
};
m_pHashForUpdates.Add(target, hashElement);
}
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:43,代码来源:CCScheduler.cs
注:本文中的SelectorProtocol类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论