本文整理汇总了C#中CCControlEvent类的典型用法代码示例。如果您正苦于以下问题:C# CCControlEvent类的具体用法?C# CCControlEvent怎么用?C# CCControlEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CCControlEvent类属于命名空间,在下文中一共展示了CCControlEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: onAnimationsTestClicked
public void onAnimationsTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
// Load node graph (TestAnimations is a sub class of CCLayer) and retrieve the ccb action manager
CCBAnimationManager actionManager = null;
/* Create an autorelease CCNodeLoaderLibrary. */
CCNodeLoaderLibrary ccNodeLoaderLibrary = CCNodeLoaderLibrary.NewDefaultCCNodeLoaderLibrary();
ccNodeLoaderLibrary.RegisterCCNodeLoader("TestHeaderLayer", new Loader<TestHeaderLayer>());
ccNodeLoaderLibrary.RegisterCCNodeLoader("TestAnimationsLayer", new Loader<AnimationsTestLayer>());
/* Create an autorelease CCBReader. */
var ccbReader = new CCBReader(ccNodeLoaderLibrary);
/* Read a ccbi file. */
// Load the scene from the ccbi-file, setting this class as
// the owner will cause lblTestTitle to be set by the CCBReader.
// lblTestTitle is in the TestHeader.ccbi, which is referenced
// from each of the test scenes.
CCNode animationsTest = ccbReader.ReadNodeGraphFromFile("ccb/ccb/TestAnimations.ccbi", this, ref actionManager);
((AnimationsTestLayer) animationsTest).setAnimationManager(actionManager);
mTestTitleLabelTTF.Label = ("TestAnimations.ccbi");
CCScene scene = new CCScene();
scene.AddChild(animationsTest);
/* Push the new scene with a fancy transition. */
CCColor3B transitionColor;
transitionColor.R = 0;
transitionColor.G = 0;
transitionColor.B = 0;
CCDirector.SharedDirector.PushScene(new CCTransitionFade(0.5f, scene, transitionColor));
}
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:35,代码来源:HelloCocosBuilder.cs
示例2: valueChanged
public void valueChanged(object sender, CCControlEvent controlEvent)
{
var pSlider = (CCControlSlider) sender;
// Change value of label.
if (pSlider.Tag == 1)
m_pDisplayValueLabel.Text = (String.Format("Upper slider value = {0:0.00}", pSlider.Value));
if (pSlider.Tag == 2)
m_pDisplayValueLabel.Text = (String.Format("Lower slider value = {0:0.00}", pSlider.Value));
}
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:9,代码来源:CCControlSliderTest.cs
示例3: valueChanged
/* Callback for the change value. */
public void valueChanged(object sender, CCControlEvent controlEvent)
{
var pSwitch = (CCControlSwitch) sender;
if (pSwitch.IsOn())
{
m_pDisplayValueLabel.Label = ("On");
}
else
{
m_pDisplayValueLabel.Label = ("Off");
}
}
开发者ID:eickegao,项目名称:cocos2d-xna,代码行数:13,代码来源:CCControlSwitchTest.cs
示例4: onCCControlButtonClicked
public void onCCControlButtonClicked(object obj, CCControlEvent pCCControlEvent)
{
switch (pCCControlEvent)
{
case CCControlEvent.TouchDown:
mCCControlEventLabel.Text = ("Touch Down.");
break;
case CCControlEvent.TouchDragInside:
mCCControlEventLabel.Text = ("Touch Drag Inside.");
break;
case CCControlEvent.TouchDragOutside:
mCCControlEventLabel.Text = ("Touch Drag Outside.");
break;
case CCControlEvent.TouchDragEnter:
mCCControlEventLabel.Text = ("Touch Drag Enter.");
break;
case CCControlEvent.TouchDragExit:
mCCControlEventLabel.Text = ("Touch Drag Exit.");
break;
case CCControlEvent.TouchUpInside:
mCCControlEventLabel.Text = ("Touch Up Inside.");
break;
case CCControlEvent.TouchUpOutside:
mCCControlEventLabel.Text = ("Touch Up Outside.");
break;
case CCControlEvent.TouchCancel:
mCCControlEventLabel.Text = ("Touch Cancel.");
break;
case CCControlEvent.ValueChanged:
mCCControlEventLabel.Text = ("Value Changed.");
break;
default:
Debug.Assert(false);
break;
}
}
开发者ID:h7ing,项目名称:CocosSharp,代码行数:36,代码来源:ButtonTest.cs
示例5: SendActionsForControlEvents
/**
* Sends action messages for the given control events.
*
* @param controlEvents A bitmask whose set flags specify the control events for
* which action messages are sent. See "CCControlEvent" for bitmask constants.
*/
public virtual void SendActionsForControlEvents(CCControlEvent controlEvents)
{
// For each control events
for (int i = 0; i < ControlEventTotalNumber; i++)
{
// If the given controlEvents bitmask contains the curent event
if ((controlEvents & (CCControlEvent) (1 << i)) != 0)
{
// Call invocations
// <CCInvocation*>
CCRawList<CCInvocation> invocationList = DispatchListforControlEvent((CCControlEvent) (1 << i));
foreach (CCInvocation invocation in invocationList)
{
invocation.Invoke(this);
}
}
}
}
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:26,代码来源:CCControl.cs
示例6: ColourValueChanged
/** Callback for the change value. */
public void ColourValueChanged(Object sender, CCControlEvent controlEvent)
{
CCControlColourPicker pPicker = (CCControlColourPicker)sender;
_colorLabel.Text = string.Format("#{0:X00}{1:X00}{2:X00}", pPicker.Color.R, pPicker.Color.G, pPicker.Color.B);
}
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:7,代码来源:CCControlColourPickerTest.cs
示例7: onCCControlButtonWaveClicked
public void onCCControlButtonWaveClicked(object pSender, CCControlEvent pCCControlEvent)
{
mAnimationManager.RunAnimations("Wave", 0.3f);
}
开发者ID:eickegao,项目名称:cocos2d-xna,代码行数:4,代码来源:AnimationTest.cs
示例8: CCInvocation
public CCInvocation(object target, SEL_CCControlHandler action, CCControlEvent controlEvent)
{
m_target = target;
m_pAction = action;
m_pControlEvent = controlEvent;
}
开发者ID:CartBlanche,项目名称:cocos2d-xna,代码行数:6,代码来源:CCInvocation.cs
示例9: onCCControlButtonFunkyClicked
public void onCCControlButtonFunkyClicked(object pSender, CCControlEvent pCCControlEvent)
{
mAnimationManager.RunAnimationsForSequenceNamedTweenDuration("Funky", 0.3f);
}
开发者ID:KerwinMa,项目名称:CocosSharp,代码行数:4,代码来源:AnimationTest.cs
示例10: AddTargetWithActionForControlEvent
public void AddTargetWithActionForControlEvent(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvent)
{
// Create the invocation object
var invocation = new CCInvocation(target, action, controlEvent);
// Add the invocation into the dispatch list for the given control event
CCRawList<CCInvocation> eventInvocationList = DispatchListforControlEvent(controlEvent);
eventInvocationList.Add(invocation);
}
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:9,代码来源:CCControl.cs
示例11: HueSliderValueChanged
//virtual ~ControlColourPicker();
public void HueSliderValueChanged(Object sender, CCControlEvent controlEvent)
{
_hsv.h = ((CCControlHuePicker) sender).Hue;
// Update the value
RGBA rgb = CCControlUtils.RGBfromHSV(_hsv);
// XXX fixed me if not correct
base.Color = new CCColor3B((byte) (rgb.r * 255.0f), (byte) (rgb.g * 255.0f), (byte) (rgb.b * 255.0f));
// Send Control callback
SendActionsForControlEvents(CCControlEvent.ValueChanged);
UpdateControlPicker();
}
开发者ID:Ratel13,项目名称:cocos2d-xna,代码行数:14,代码来源:CCControlColourPicker.cs
示例12: onSpriteTestClicked
public void onSpriteTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestSprites.ccbi", "TestSpritesLayer", new Loader<SpriteTestLayer>());
}
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:4,代码来源:HelloCocosBuilder.cs
示例13: CCInvocation
public CCInvocation(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvent)
{
Target = target;
Action = action;
ControlEvent = controlEvent;
}
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:6,代码来源:CCInvocation.cs
示例14: onParticleSystemTestClicked
public void onParticleSystemTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestParticleSystems.ccbi", "TestParticleSystemsLayer", new Loader<ParticleSystemTestLayer>());
}
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:4,代码来源:HelloCocosBuilder.cs
示例15: onScrollViewTestClicked
public void onScrollViewTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestScrollViews.ccbi", "TestScrollViewsLayer", new Loader<ScrollViewTestLayer>());
}
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:4,代码来源:HelloCocosBuilder.cs
示例16: onMenuTestClicked
public void onMenuTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestMenus.ccbi", "TestMenusLayer", new Loader<MenuTestLayer>());
}
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:4,代码来源:HelloCocosBuilder.cs
示例17: onButtonTestClicked
public void onButtonTestClicked(object pSender, CCControlEvent pCCControlEvent)
{
openTest("ccb/ccb/TestButtons.ccbi", "TestButtonsLayer", new Loader<ButtonTestLayer>());
}
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:4,代码来源:HelloCocosBuilder.cs
示例18: touchDragOutsideAction
public void touchDragOutsideAction(object sender, CCControlEvent controlEvent)
{
m_pDisplayValueLabel.Label = ("Drag Outside");
}
开发者ID:eickegao,项目名称:cocos2d-xna,代码行数:4,代码来源:CCControlButtonTest.cs
示例19: RemoveTargetWithActionForControlEvents
/**
* Removes a target and action for a particular event (or events) from an
* internal dispatch table.
*
* @param target The target object�that is, the object to which the action
* message is sent. Pass nil to remove all targets paired with action and the
* specified control events.
* @param action A selector identifying an action message. Pass NULL to remove
* all action messages paired with target.
* @param controlEvents A bitmask specifying the control events associated with
* target and action. See "CCControlEvent" for bitmask constants.
*/
public virtual void RemoveTargetWithActionForControlEvents(object target, Action<object, CCControlEvent> action, CCControlEvent controlEvents)
{
// For each control events
for (int i = 0; i < ControlEventTotalNumber; i++)
{
// If the given controlEvents bitmask contains the curent event
if ((controlEvents & (CCControlEvent) (1 << i)) != 0)
{
RemoveTargetWithActionForControlEvent(target, action, (CCControlEvent) (1 << i));
}
}
}
开发者ID:460189852,项目名称:cocos-sharp-samples,代码行数:25,代码来源:CCControl.cs
示例20: AddTargetWithActionForControlEvents
/**
* Adds a target and action for a particular event (or events) to an internal
* dispatch table.
* The action message may optionnaly include the sender and the event as
* parameters, in that order.
* When you call this method, target is not retained.
*
* @param target The target object�that is, the object to which the action
* message is sent. It cannot be nil. The target is not retained.
* @param action A selector identifying an action message. It cannot be NULL.
* @param controlEvents A bitmask specifying the control events for which the
* action message is sent. See "CCControlEvent" for bitmask constants.
*/
public virtual void AddTargetWithActionForControlEvents(object target, SEL_CCControlHandler action, CCControlEvent controlEvents)
{
// For each control events
for (int i = 0; i < kControlEventTotalNumber; i++)
{
// If the given controlEvents bitmask contains the curent event
if (((int) controlEvents & (1 << i)) != 0)
{
AddTargetWithActionForControlEvent(target, action, (CCControlEvent) (1 << i));
}
}
}
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:25,代码来源:CCControl.cs
注:本文中的CCControlEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论